Restrict Search from showing everything

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
CapereSpiritum
Forum Members
Forum Members
Posts: 223
Joined: Wed Dec 28, 2011 12:11 pm

Restrict Search from showing everything

Post by CapereSpiritum »

Hi, I'm trying to understand how to refine search results for a site using Company Directory and News for most of the websites content.

How would I restrict the search results to only show CD and News entries.

Any help will be much appreciated.

CMSMS Version 2.1.6
AdminSearch 1.0.2
Album 1.11
CGCalendar 2.4.4
CGExtensions 1.55.6
CGFeedback 1.8.3
CGGoogleMaps2 1.1.1
CGSimpleSmarty 2.1.6
CGSmartImage 1.21.9
CGStaticMaps 1.0.2
CMSContentManager 1.1.4
CMSMailer 6.2.14
Captcha 0.5.5
CompanyDirectory 1.23.5
DesignManager 1.1.1
FileManager 1.5.2
FormBuilder 0.8.1.6
JQueryTools 1.4.0.3
MicroTiny 2.0.3
ModuleManager 2.0.5
Navigator 1.0.3
News 2.50.6
Search 1.50.2
Jos
Support Guru
Support Guru
Posts: 4020
Joined: Wed Sep 05, 2007 8:03 pm

Re: Restrict Search from showing everything

Post by Jos »

As far as I remember there is a nice and clear example in the search result template itself. Check it in the DesignManager.
CapereSpiritum
Forum Members
Forum Members
Posts: 223
Joined: Wed Dec 28, 2011 12:11 pm

Re: Restrict Search from showing everything

Post by CapereSpiritum »

Hi Jos
Yes, I saw that. it shows:

Code: Select all

{if $entry->module == 'News'}{News action='detail' article_id=$entry->modulerecord detailpage='News'}
So I added:

Code: Select all

<li>{if $entry->module == 'CompanyDirectory'}{CompanyDirectory action='detail' article_id=$entry->modulerecord detailpage='entry-details'}{$entry->title} - <a href="{$entry->url}">View Result</a>{/if}</li>
I get a page not found error

There's gotta be something pretty basic that I'm missing.
Any clues?

Thanks
Simon
scooper
Forum Members
Forum Members
Posts: 242
Joined: Fri Dec 09, 2005 12:36 pm

Re: Restrict Search from showing everything

Post by scooper »

There is a parameter you can add to your Search tag for only showing only results from specified modules if that's what you're after...

Code: Select all


(optional) modules="null" - Limit search results to values indexed from the specified (comma separated) list of modules

Post Reply

Return to “Modules/Add-Ons”