Search our Community widget site wide in Scholar?

Hi Tammie,
Is there anyway to keep the sidebar widget 'Search Our Community' from the homepage of Scholar and make it site wide. It appears constantly in the header of the default theme but only on the Homepage of the Scholar theme.
Any ideas?

Thanks again and hope you don't mind all of the questions!
Ross :slight_smile:

  • Tammie

    @rossagrant: no problem at all feel free to ask questions that's what we're here for to help. What you would have to do is a little code modification but it's nothing major at all so let me talk you through the steps. The key bit of code is in sidebar-home.php:

    <div class="h4-background"><h4> <?php _e( 'Search our community', 'bp_scholar' ) ?></h4></div>
    <div class="widget-wrapper">
    <form action="<?php echo bp_search_form_action() ?>" method="post" id="search-form">
    <input type="text" id="search-terms" name="search-terms" onfocus="if (this.value == '<?php _e( 'Start Searching...' ) ?>') {this.value = '';}" onblur="if (this.value == '') {this.value = '<?php _e( 'Start Searching...' ) ?>';}" size="25"/>
    <?php echo bp_search_form_type_select() ?>
     <input type="submit" name="search-submit" id="search-submit2" value="<?php _e( 'Search', 'buddypress' ) ?>" class="search-dark"/>
    <?php wp_nonce_field( 'bp_search_form' ) ?>
    </form>
    </div>

    You want to then open each sidebar file but not the footer ones of course :slight_smile: so you'd want to open up the following files:

    sidebar-3colleft
    sidebar-3colright
    sidebar-blogs-directory
    sidebar-groups-directory
    sidebar-left
    sidebar-members-directory
    sidebar-members
    sidebar-page
    sidebar-right

    These can all be found under sidebars/. It may see like a lot but just take that code I gave you before and after you see the following in all of those files add it:

    <div id="sidebar">

    or in some files you may see:

    <div id="front-sidebar">
    or
    <div id="sidebar-right">

    Whatever you see it would be line 1 if you have a code line indicator. Just put the code I gave you under that and save the file and it should all work for you.

    Let me know if you have any issues.

  • rossagrant

    Actually Tammie,
    Slight change of plan. Sorry about this.

    the reason I wanted that search site wide was to try to avoid a problem with BP itself I think and not your theme.
    Try this:
    Search for a group in the sidebar widget from the homepage. If you look closely this will take you to a group page with an absolute URL for that search e.g.

    http://sharespeak.co.uk/groups/?s=a

    If you then try to change the search in this window you cannot actually search for anything else. It just refreshes the previous search effectively.

    I have noticed that whichever search you put into the search our community widget also appears in the site wide search box at the top of the results page.

    Is that supposed to happen?

    Anyway, if this is a problem in BP we can't do much about it.
    I'm happy with having the search for groups and forums and members on those actual pages so my question now is how to REMOVE the Search our community widget from the homepage.

    I tried deleting the code under the home.php sidebar file but obviously got it wrong. I've restored it and await your instruction.
    Thanks again.
    Ross :slight_smile: