Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2007-03-03 09:19:27

resplence
Member
Registered: 2006-03-07
Posts: 37

Problems with search and its conditionals

I was trying to improve the default search results and looking for a way to show something if a search results in no matches and I found <txp:if_search_results> in the wiki.

First I tried using it in the search_results form itself, it returned no results. I realized it was probably wrong and used on the page template for the search, shown below:

<txp:if_search_results>
<txp:article allowoverride="0" form="search_results" limit="99999" pageby="40" pgonly="0" searchall="1" searchsticky="0" sort="Posted desc" />
<txp:else />
<p>Sorry, we were not able to find a page matching your search request.</p>
</txp:if_search_results>

It also returned zero results. What am I missing?

Also, <txp:search_result_count /> (wiki) is not counting search results. It only displays articles found; the default text complement to the number of matches. Solution: Using Search in Textpattern

Last edited by resplence (2007-03-03 11:40:12)

Offline

#2 2007-03-04 02:10:34

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

Re: Problems with search and its conditionals

The tag only exists in a development, non-stable version of Textpattern.

TextBook: Alphabetical Tag Listing:

Note: if you are adding new tags/attributes from development versions of Textpattern, please list them elsewhere to help avoid confusion. Only the latest stable version of Textpattern is officially supported, and this list should only reflect the latest stable version.

Offline

#3 2007-03-04 02:29:58

resplence
Member
Registered: 2006-03-07
Posts: 37

Re: Problems with search and its conditionals

Oh I hadn’t realized that, Mary. Thanks.

Offline

Board footer

Powered by FluxBB