Membership Directory (or other profile search option)

I am using the membership directory plugin, which works great, but what I want to do is create a new page and then use a shortcode of some sort to put that search in the middle of a page. Is that possible, or is there a different plugin I should use?

Thanks, David

  • Mason
    • DEV MAN’s Sidekick

    Hiya David,

    The Member Directory plugin is meant to provide a very general member listing option. You're wanting the ability to search the member directory specifically? or provide a general search?

    A search option could be custom coded for ya (though that's a bit beyond what we can support in the forums). It wouldn't be too difficult to do though. You could request a quote here:
    https://premium.wpmudev.org/wpmu-jobs/

  • David
    • The Incredible Code Injector

    Thanks - the idea would be have some check boxes. So for example if I am searching for a therapist and I know I want to find a male or a female. I would then have a check box that gives that option for the search, and then in the profile they would select what fits. So I agree, probably pretty easy to code, so I will have to put that to my development list and prioritize accordingly. Just wasn't sure if it was so easy I might be able to do :slight_smile:.

    Thanks for the quick response!

  • David
    • The Incredible Code Injector

    Oh geeze, I responded to a different question I had on my mind :slight_smile:. All I want to do is real simple. I want to have a page where I insert the search box on that page, in the middle. So simply I want to introduce some text and recommendations on what to search for, then have that search box, and then have more text after.

    To me this seems like core functionality of this, but maybe there is another plugin I should use? This is so people can come to my site, search for therapists (so really just searching profile pages) and find who fits their request.

    Thanks, David

  • Mason
    • DEV MAN’s Sidekick

    Hiya David,

    So, you're really just looking to provide the search function from Members Directory on your own unique page is that correct?

    This plugin is meant to very simply create a listing of members and quick search at the top of the page. You'd have to modify it in order to create a page with custom content. You can go to the 'members' page in WordPress that should've been created when you activated the plugin and add some text here. This will appear at the top of the Member Directory Page.

    Other customizations such as removing the listing and providing more text below the search would require a developer to do some work for you. There's always our Job Boards if you want to post something up:
    https://premium.wpmudev.org/wpmu-jobs/

  • Mason
    • DEV MAN’s Sidekick

    Looking at this further though, you could create a custom page template and copy the search function from the plugin. You'd then create a new page in WordPress and use the new page template for it.

    Any content you placed in the WordPress page would appear above the search and any content you wanted to appear below could be hardcoded into the template page (extremely "hacky").

    Additionally, the results page would still use the default members/search slug so you could also customize this page within WordPress so that the results does not contain the same content as the search page.

    Here's a quick hack I through together based on the twentyeleven page template. Use with caution :slight_smile:

    <?php
    /**
     * Template Name: Directory Page
     *
     * Selectable from a dropdown menu on the edit page screen.
     */
    get_header(); ?>
    
    		<div id="primary">
    			<div id="content" role="main">
    <?php
    
    function custom_member_search_form_output($content, $phrase) {
    	global $wpdb, $current_site, $members_directory_base;
    	if ( !empty( $phrase ) ) {
    		$content .= '<form action="' . $current_site->path . $members_directory_base . '/search/' . urlencode( $phrase ) . '/" method="post">';
    	} else {
    		$content .= '<form action="' . $current_site->path . $members_directory_base . '/search/" method="post">';
    	}
    		$content .= '<table border="0" border="0" cellpadding="2px" cellspacing="2px" width="100%" bgcolor="">';
    		$content .= '<tr>';
    		    $content .= '<td style="font-size:12px; text-align:left;" width="80%">';
    				$content .= '<input name="phrase" style="width: 100%;" type="text" value="' . $phrase . '">';
    			$content .= '</td>';
    			$content .= '<td style="font-size:12px; text-align:right;" width="20%">';
    				$content .= '<input name="Submit" value="' . __('Search') . '" type="submit">';
    			$content .= '</td>';
    		$content .= '</tr>';
    		$content .= '</table>';
    	$content .= '</form>';
    	return $content;
    }
    
    add_filter('the_content', 'custom_member_search_form_output', 20);
    
    ?>
    				<?php the_post(); ?>
    
    				<?php get_template_part( 'content', 'page' ); ?>
    				Additional Text could go right here. It's a little tacky, but it works :)
    			</div><!-- #content -->
    		</div><!-- #primary -->
    
    <?php get_footer(); ?>
  • David
    • The Incredible Code Injector

    Oh, one other interesting note, for my testing text doesn't show up at the top of the page on the standard members page created by the plugin. Not sure if that is by design, or if I am overlooking something...

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.