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.

How can I show "Your search for [[insert search term here]] found no matches" on my no_results_page?

July 19, 2007 2:03pm

Subscribe [3]
  • #1 / Jul 19, 2007 2:03pm

    How can I show “Your search for [[insert search term here]] found no matches” on my no_results_page?

  • #2 / Jul 19, 2007 7:55pm

    Lisa Wess

    20502 posts

    Hi,

    You can use:

    {exp:search:keywords}

    On your no_results template. =)

  • #3 / Aug 11, 2007 3:13am

    Mark Wushu

    58 posts

    Hi - not sure if this is a silly question.

    I’m working on the search part of my site with a recent install of Expression Engine. I’ve been able to edit the search results page for when there are results, but I can’t seem to find the template for when there are no results or nothing is entered in the search box (simple search).

    The only templates in the search area I have are the 3 default ones (index, search_results and search_css).

    How do I get to the code that pushes out the search results page for when there are no results? (Its the simple page with the message in a grey box)

    Many thanks for any help!

    Mark

  • #4 / Aug 11, 2007 12:40pm

    Derek Jones

    7561 posts

    Your search tag needs to use a no_result_page= parameter to provide it with a template to you for no results.  The default without this parameter is what you are seeing now: a basic dynamically generated user message page (which you can customize the design of in your Specialty Templates section of the Admin area).

  • #5 / Aug 13, 2007 12:01am

    Mark Wushu

    58 posts

    Thanks for that Derek - I missed that page! I’ve managed to include that parameter and now successfully displayed my template when there are no results!

    I’ve also successfully amended the Speciality Template although I noticed that embed tags and the usual “exp” tags don’t render. Is there a way to get them to?

    Many thanks for your help!

    Mark

  • #6 / Aug 13, 2007 12:12am

    Derek Jones

    7561 posts

    No, sorry, the user message template can only contain HTML and the five required variables: {title} {meta_refresh} {heading} {content} {link}.  Due to the way this special dynamic template is rendered, ExpressionEngine tags and PHP are unavailable.

  • #7 / Aug 13, 2007 12:22am

    Mark Wushu

    58 posts

    Ok, no worries - thanks!

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

ExpressionEngine News!

#eecms, #events, #releases