Creating a link to search for a keyword - is it possible?

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
heffegg
Forum Members
Forum Members
Posts: 43
Joined: Sat Mar 08, 2008 2:10 am

Creating a link to search for a keyword - is it possible?

Post by heffegg »

Hi.
My client wants to have a list of keywords - for example "apple", "orange", "pear"
They want these words to be links that when clicked will search for matching results.
For example click on 'apple' will return a list of recipes that contain "apple"

Is this possible?
If so, can someone give me an example of the script/code required to implement this.

If not...  any ideas short of writing my own cms would be appreciated.

TIA
Heff.
jmcgin51
Power Poster
Power Poster
Posts: 1899
Joined: Mon Jun 12, 2006 9:02 pm

Re: Creating a link to search for a keyword - is it possible?

Post by jmcgin51 »

will this (the list of word-links) be a hard-coded list, or a dynamic list?
heffegg
Forum Members
Forum Members
Posts: 43
Joined: Sat Mar 08, 2008 2:10 am

Re: Creating a link to search for a keyword - is it possible?

Post by heffegg »

hard-coded links from a chart.
I have implemented a fix using copy/paste from a search, but I am sure there must be a better way.
Peciura

Re: Creating a link to search for a keyword - is it possible?

Post by Peciura »

This is a basic example with only 3 words.
{assign var=search_phrases value=','|explode:'home,two,three'}
{foreach from=$search_phrases item='phrase'}
{cms_selflink page=$page_alias text=$phrase urlparam='&mact=Search,cntnt01,dosearch,0&submit=submit&cntnt01searchinput='|cat:$phrase}
{/foreach}
Andrew Prior
Forum Members
Forum Members
Posts: 248
Joined: Sun Oct 28, 2007 4:14 am

Re: Creating a link to search for a keyword - is it possible

Post by Andrew Prior »

Peciura, that is a very cool scrap of code. Thanks!
Post Reply

Return to “Modules/Add-Ons”