Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Remove top category in search results ?

Quote Reply
Remove top category in search results ?
Is there any way to remove the top category - in the example below "Archive"?

Search Results

Your search for america returned 5 results.

Archive : Declaration Of Independence Approved
Archive : A Nuclear Reactor Melts Down In The USA
Archive : US President Bush Vomits On Japanese Leader
Archive : Columbus Reaches The "New World"
Archive : The Panama Canal Is Opened

Thanks,
--Jo

Last edited by:

iplay: Jun 14, 2011, 5:03 AM
Quote Reply
Re: [iplay] Remove top category in search results ? In reply to
Mmm, not easily (as it would throw the results off, in terms of the reported number of results)

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [iplay] Remove top category in search results ? In reply to
Hi,

It depends on you current settings. If the 'build_search_gb' is 'No', you can add the below code beneath the '<%~loop category_results_loop%>' in the search_results.html

<%~loop category_results_loop%>
<%if Full_Name contains 'Archive'%>
<%else%>
... as current...
<%endif%>
<%endloop%>

Cheers,

Dat

Programming and creating plugins and templates
Blog
Quote Reply
Re: [tandat] Remove top category in search results ? In reply to
Yup, as I said though, that will mess up the category count Smile (i.e "Your search returned xxx categories and xx links")

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Remove top category in search results ? In reply to
Hi Andy,

You are right! That could cause confusion. And in some cases, the page could be empty because the results are only category and they are "hidden" by the code.

So, I think just copy that code into the top of the template. And in the <%if... statement, we can deduce "cat count" and if the hits <1, we can call the search form.

Cheers,

Dat

Programming and creating plugins and templates
Blog
Quote Reply
Re: [tandat] Remove top category in search results ? In reply to
Thanks for the above answers. They are all very useful despite their apparent contradictions.

Thanks,
--Jo

Last edited by:

iplay: Jun 18, 2011, 10:37 PM