remove search for a module

This is a FORK of the CMS Made Simple project and is not oficially supported in any way by the CMS Made Simple development team.
Locked
User avatar
grudz
Forum Members
Forum Members
Posts: 66
Joined: Mon Jul 28, 2008 4:54 pm

remove search for a module

Post by grudz »

Hello,

I am using MLE 1.6.6 and the modules Search (1.6.1) and Gallery (1.2) and was wondering how to make the Search module NOT index the gallery folder. Basically i have a gallery that is indexed in my search module, that works perfectly, however, the results always give me and extra link to the image directly in both of my languages. It might be easier to show it

http://www.tillemont.com/eng/home.html? ... mit=Submit

notice I have 3 links,

Fun cakes (which is what i want) --- link to my page
Gallery (which is what i DO NOT want)
Gallery (which is what i DO NOT want)

I only want the "Fun cakes" link

Thank you
Jos
Support Guru
Support Guru
Posts: 4017
Joined: Wed Sep 05, 2007 8:03 pm
Location: The Netherlands

Re: remove search for a module

Post by Jos »

I guess you can adjust the Search "Result Template". Use some smarty code to filter out the Gallery results. There's allready an example for News in the template code.
carasmo
Power Poster
Power Poster
Posts: 506
Joined: Thu Feb 08, 2007 6:11 pm
Location: Florida

Re: remove search for a module

Post by carasmo »

Did you figure this out? I'm having the exact same problem. Since I know pretty much nothing about smarty, I will need to hire someone to write this.
Peciura

Re: remove search for a module

Post by Peciura »

@Carasmo to skip search results from "Gallery" module you can modify default search template like this:
{$searchresultsfor} "{$phrase}"
{if $itemcount > 0}

{foreach from=$results item=entry}

{if (empty($entry->module)) || ($entry->module != 'Gallery')}
{$entry->title} - url}">{$entry->urltxt} ({$entry->weight}%)
{*
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'}
*}

{/if}
{/foreach}


{$timetaken}: {$timetook}
{else}
{$noresultsfound}
{/if}
User avatar
grudz
Forum Members
Forum Members
Posts: 66
Joined: Mon Jul 28, 2008 4:54 pm

Re: remove search for a module

Post by grudz »

wow, that simple huh? thank you very much Peciura.
Locked

Return to “[locked] CMSMS MLE fork”