BuddyPress.org’s Unified Search – How can I get it?
I couldn’t help noticing BuddyPress.org’s unified search feature. Love the idea of having a search form with no select options. The search results are also nice in that they display results from each section of the site. Is this coming to BP or is this a plugin of some sort?
If you don’t mind dabbling with BP code… sitewide search could be implemented like this (I say “could” because I haven’t tried it yet).
First a form needs to be created with an input field. Then, you’d need to create a new page (in BuddyPress or a page in WordPress with a page template) and add a bunch of BP loops that checks for the same input field variable.
I had done it for one of my premium themes and I am in the process of publishing a tutorial too(Still incomplete). It is simple and can be achieved via theme itself, no plugin is required. No mod to your theme(other than adding a blank template file with a do action).
Let me know if you guys want, I will put the code on the pastabin.
Btw, My solutions hooks on the top of bp-functions, so there is no need to create a form(It will just take the bp form and hide the drop down),
@sbrajesh would love to see that tutorial or the code on pastebin, please publish…
@sbrajesh interested in seeing your tutorial as well.
As an aside, I came across this “sitewide” solution using Google Custom Search (not a bad option):
here is your code
Put the code of functions.php in your functions.php and move the single-search.php and search-loop.php to your theme.
You may check more details on my site here.
@mods: hope I am not doing anything wrong, but if you feel it inappropriate linking my own site, please feel free to edit this post
Edit: Sorry, the initial download link was incorrect
Gee, how can I “favourite” this thread ?
@sbrajesh thanks for this tut, and would love to see a sample of your bp mag theme !
Hey Brajesh, your link is fine. It’s a tutorial write-up and a plugin! Thanks for contributing!
One question: haven’t tested this yet, but does pagination work for each of the different components in the search results?
Woow! Great @sbrajesh! Just got it working but the design itself is a bit messed up.. but I’ll try to take a look at it tomorrow, and post the results and layout improvements here.. thanks for the tutorial!
@sBrajesh could you also post your CSS code for this (on Pastebin)? Then I can modify it for the BP-Default theme, and post it here tomorrow morning (it’s night here).
@el_terko Thanks It is coming soon, I am still in the process of power packing it with customizable features for developers
@r-a-y Thanks Ray, you are the rocking mod here , No, I have not handled the case of pagination, but not checked that too(there were very few results on my test install), so May be I can add some more test post and will check that. Hopefully that should work or if it does not work, a slight change in ‘bpmag_global_search_qs’ can make that work. Btw, there are links below the search results for each component to let you see the component search page. It’s something like I saw on some social networks and thought to implement for my BP.
@bowromir hey Bowe, that’s great Yes, I mentioned it in the tutorial. The layout code was from my theme bp-mag which is slightly different from bp-defult.. That’s why you may see some differences(and obviously I have not supplied any css and left it upto the developers)
The point was, have it in your theme and mod it as you want, that’s the reason I did not pack it as a plugin(as I promised in one of my posts 2 week ago on the site).
As always you da man… thanks so much, works perfectly
@sbrajesh what they all said. Working great in my installs. Cheers!
Actually, from first blush I was under the impression that unified search would be a feature of BP 1.2.4. Am I wrong?
I did it with just a template. Copy and paste the members, groups, forums, and activity loops into a new template file. Add the parameter ‘search_terms=’ . esc_html( $_GET ) to each of the loops and then create a new WordPress page called search and assign the template file to it. Then just pass ?f=searchterms to the URL and bob’s your uncle.
@apeatling: Pagination on the search template isn’t working “Page Not Found” (i tried it with search term “search”). Will the unified search be part of Buddypress 1.3, or is ot buddypress.org only?
I would also like to see this in the next version if possible (along with post to x feature of this installation). @apeatling if not I’m going to use this tutorial.
- The topic ‘BuddyPress.org’s Unified Search – How can I get it?’ is closed to new replies.