ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Search Link

August 31, 2011 12:31pm

Subscribe [2]
  • #1 / Aug 31, 2011 12:31pm

    Hi. Is it possible to have a link that when clicked searches its contents.

    For example:

    <a href="http://link">{gallery_keywords}</a>

    The ‘gallery_keywords’ are brought in from the article entry, and each could be clicked and searched separately.

    Thank you!

  • #2 / Aug 31, 2011 11:17pm

    Dan Decker

    7338 posts

    Chris,

    I’m afraid that the way our search module operates, that wouldn’t be possible in the manner you describe. The search module runs the query, caches the results, and returns a token to that cache to the results page for better performance. You could likely do something similar to this however:

    {exp:search:simple_form channel="news"}
    <input type=“hidden" name="keywords" id="keywords" value="{gallery_keywords}" />
    <input type="submit" value="submit" class="submit" />
    {/exp:search:simple_form}

    You could use some javascript to make a link to submit the form, and the {gallery_keywords} variable would need to contain words separated by a space, but it should work.

    Cheers,

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases