Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2006-09-23 15:55:07

deronsizemore
Member
From: Kentucky
Registered: 2005-11-02
Posts: 324

Displaying message if no search results?

Just wondering if it’s possible and how you’d go about displaying a message like “your search returned no results” if the search comes up with not results rather than just displaying a blank page?

Offline

#2 2006-09-23 16:06:00

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: Displaying message if no search results?

Try this.

Offline

#3 2006-09-23 21:19:37

deronsizemore
Member
From: Kentucky
Registered: 2005-11-02
Posts: 324

Re: Displaying message if no search results?

Hi! Thanks for the link.

I was looking at Mary’s example of

<code>
<txp:if_search>

<txp:chh_if_data>

<!— we searched, and there were results —> <txp:article />

<txp:else />

<!— we searched and nothing was found —> <p>No results found.</p>

</txp:chh_if_data>

<txp:else />

<!— we didn’t search for anything —> <txp:article />

</txp:if_search>
</code>
<br />
But I’m still not sure where I’m suppose to put this code? Would be in the search_results form?

Offline

#4 2006-09-23 21:31:32

bancroft
Member
Registered: 2005-09-30
Posts: 39

Re: Displaying message if no search results?

You’d normally put it in your default page template. Replacing your <code><txp:article /></code> tag

Last edited by bancroft (2006-09-23 21:33:41)

Offline

#5 2006-09-23 21:48:49

deronsizemore
Member
From: Kentucky
Registered: 2005-11-02
Posts: 324

Re: Displaying message if no search results?

Oh okay. I think I see now. Thanks! :-)

Offline

Board footer

Powered by FluxBB