Search Our Community Widget in BP Daily.

Hi again Tammie,
You've helped me with a similar query before so sorry to keep asking about this but I have a little query about the 'Search Our Community' Widget.

My issue is that if I search for a particular search term and then select group and hit search it takes me to a page where the url reflects the search term.
For example: If I search for the group on my site called 'Provexis' it takes me to a page with the URL:

Now this is fine for the initial search but if I use the 'Search anything' box in the group directory to search for another group, it merely returns this page for EVERY search term.

When you use the 'Search Anything' box first on the groups page, it searches the groups without changing the URL from .../groups so you can keep searching different terms.

Is there anyway to alter the widget to fix this or could you give me the steps to remove this widget within the BP Daily Theme. I've tried altering the sidebar.php files but I must be removing too much code as it's messing up the entire bar :slight_frown:

I love the widget as it covers groups, forums and members but it might just be a bit confusing having box the 'search Our Community' search box and the 'Search Anything' boxes on the same page that's all.

Thanks so much for your continued help, I owe you big time! :slight_smile:

  • rossagrant

    Hey Tammie,
    When I use the default theme there isn't a 'Search our Community widget' so I guess that is something you have developed for the themes you produce.

    The problem only arises if you search with the 'Search our Community' widget as it produces the page with the search term in the URL.

    This locks you into that page and when you try to search again using the default searches in BP it doesn't work.
    It's hard to explain but try it out.

    Do a search using the search Our Community widget for a group and then try to search again by using the standard 'search anything' box on the groups page. You won't be able to navigate away from the page you are on, it just returns the same result over and over.

    I hope I have explained it clearly enough. Let me know if you understand the problem.
    Thanks again.
    Ross :slight_smile:

  • Tammie

    @rossagrant: er no there are 2 searches 1. the search blog / pages / posts and 2. the one that comes built in with buddypress. This is not a widget or anything just some code that is brought from the default buddypress install where you can search by members, groups, forums, blogs. Now, is this not what you are referring to as none of these are called 'search by community' so not sure I'm even in the same place as you are? Those are the only built in searches though for daily. Sorry but getting confused as to what you are referring to so want to be sure.

    Just incase this was what you were refering to I did the following:

    1. There was a group called 'another group' so using sidebar groups search did that
    2. It showed that group then I up the top search had that information in as was last search term so changed it to 'lorem' as knew there was text for that in my posts and searched
    3. Got search results for the pages and blog posts

  • rossagrant

    Now this is where the problem happens. If I use the 'Group Directory' search bar which is found on the results page that I have just been taken to (see pic) and search for another group here. For example the group called 'Moni', I can type this into the search but when I try to search it merely reloads the same search result, i.e. the group 'PXS' which it has just found.

    Hope this is a little easier to understand and sorry to mess you around.
    Ross :slight_smile:

  • Tammie

    To remove the widget remove this code whereever you see it in a sidebar:

    <form action="<?php echo bp_search_form_action() ?>" method="post" id="search-form">
    <input type="text" id="search-terms" name="search-terms" value="" size="18"/>
    <?php echo bp_search_form_type_select() ?>

    <input type="submit" name="search-submit" id="search-submit" value="<?php _e( 'Search', 'buddypress' ) ?>"/>
    <?php wp_nonce_field( 'bp_search_form' ) ?>
    </form><!-- #search-form -->