Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2007-01-16 21:58:18

dada78
Member
From: New York
Registered: 2005-10-27
Posts: 138
Website

Search results not Showing

Hi,

I follwed the textbook and placed the following code in the search_results form:

<code>
<txp:if_search_results>
<p>These articles match your search request: </p>
<txp:else />
<p>Sorry, we were not able to find a page matching your search request.</p>
</txp:if_search_results>
</code>

When I tested the search input field it displayed nothing.

When I instead put:

<code>
<p>These articles match your search request:</p>
<p><txp:search_result_title /></p>
</code>

and this time the results were displayed.

Question: What am I doing wrong here?
I would simply like to display a message when there aren’t any results.

Thanks!
Dada

Last edited by dada78 (2007-01-16 21:59:03)

Offline

#2 2007-01-16 23:46:38

thebombsite
Archived Plugin Author
From: Exmouth, England
Registered: 2004-08-24
Posts: 3,251
Website

Re: Search results not Showing

As far as I know there is no such tag as <txp:if_search_results> unless someone wants to correct me on that.


Stuart

In a Time of Universal Deceit
Telling the Truth is Revolutionary.

Offline

#3 2007-01-17 00:26:18

dada78
Member
From: New York
Registered: 2005-10-27
Posts: 138
Website

Re: Search results not Showing

Hi Bombsite,

I found the example here

Let me know if I am missing something here, which is very possible ;-)

Dada

Offline

#4 2007-01-17 19:47:16

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

Re: Search results not Showing

You’re not missing something, you’re adding something ;) The tag is <txp:if_search>, meaning: if we are on a search results page.

Have a look at chh_if_data, this plugin will do what you want.

Offline

#5 2007-01-19 10:27:31

Mary
Sock Enthusiast
Registered: 2004-06-27
Posts: 6,236

Re: Search results not Showing

There is a recently added tag if_search_results, but it only exists in a development (non-stable) version of Textpattern. Perhaps that’s where the confusion has entered.

Offline

Board footer

Powered by FluxBB