Page 1 of 1

Restrict Search from showing everything

Posted: Tue Aug 15, 2017 5:22 pm
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

Re: Restrict Search from showing everything

Posted: Tue Aug 15, 2017 9:20 pm
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.

Re: Restrict Search from showing everything

Posted: Wed Aug 16, 2017 8:53 am
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

Re: Restrict Search from showing everything

Posted: Wed Aug 16, 2017 9:15 am
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