Skip to:
Content
Pages
Categories
Search
Top
Bottom

need help adding a new tab menu to the members directory


  • gwu123
    Participant

    @gwu123

    hi,

    I want to add a new tab menu item to the members directory. We already have “All members”, “My Friends”, now i want to add “Search Members”.

    I am able to add the tab menu, and also load a different search form template file when this menu is clicked. Here is how i did it –

    1. in theme/members/index.php I added this line

    <li id="members-search">
    <a href=&quot;"></a>
    </li>

    Now I got the new menu item to be displayed.

    2. for loading the new search form template I edited the ajax.php file. In method bp_dtheme_object_template_loader() I do the loading based on object and scope –

    // Sanitize the post object
    $object = esc_attr( $_POST );
    $object_scope = esc_attr( $_POST );
    
    if($object=="members"&&$object_scope=="search"){
    locate_template( array( "$object/search-form.php" ), true );
    }else{
    // Locate the object template
    locate_template( array( "$object/$object-loop.php" ), true );
    }

    With this change when I click on the “Search” menu item i see the search form loading.

    However, my only concern is that when on this tab I do a page refresh, the search form template does not load. Instead the all members loop is displayed.

    How can I change this? On page refresh I should see the search form and not the members loop.

    thanks.

  • The topic ‘need help adding a new tab menu to the members directory’ is closed to new replies.
Skip to toolbar