Hi
Is there anyway to set the search to a group of pages but not the whole site.
Can this be done without setting pages to not searchable.
Could there be two different search buttons?
Thanks.
Search a group of set pages
Re: Search a group of set pages
I don't think the search module has any functionality for that built-in. It would need to be forked and modified.
A poor man's workaround could perhaps be a custom result template that filters out any results from unwanted pages.
A poor man's workaround could perhaps be a custom result template that filters out any results from unwanted pages.
Not getting the answer you need? CMSMS support options
Re: Search a group of set pages
I think the 'poor man's solution' isn't that bad.
It will probably be way more flexible than anything the module itself could offer. Especially considering the details of the request.
It will probably be way more flexible than anything the module itself could offer. Especially considering the details of the request.
Re: Search a group of set pages
Thanks
I will into it on the lines you suggested.
Not hopeful I know enough about it though, even though I am a poor man.
I will into it on the lines you suggested.
Not hopeful I know enough about it though, even though I am a poor man.
Re: Search a group of set pages
Consider thess examples:
Makes sense?
Then check the sample result template of Search
For content pages the module is 'content' and modulerecord the page id
Then find the page IDs of the pages you want to include. Let's assume page IDs 2,3 and 4
(untested)
Code: Select all
{if 1|in_array:[2,3,4]}yes{else}no{/if}
{if 2|in_array:[2,3,4]}yes{else}no{/if}
Then check the sample result template of Search
Code: Select all
...
{foreach from=$results item=entry}
<li>{$entry->title} - <a href="{$entry->url}">{$entry->urltxt}</a> ({$entry->weight}%)</li>
{*
You can also instantiate custom behaviour on a module by module basis by looking at
the $entry->module and $entry->modulerecord fields in $entry
ie: {if $entry->module == 'News'}{News action='detail' article_id=$entry->modulerecord detailpage='News'}
For content pages the module is 'content' and modulerecord the page id.
*}
{/foreach}
...
Then find the page IDs of the pages you want to include. Let's assume page IDs 2,3 and 4
(untested)
Code: Select all
{if $entry->module == 'content' && $entry->modulerecord|in_array:[2,3,4]}{$entry->title} - <a href="{$entry->url}">{$entry->urltxt}</a>{/if}