Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2008-04-22 11:11:23

ultramega
Member
Registered: 2006-02-26
Posts: 221

If search results amount is smaller than X, then do something

Just curious, is it possible to count search results and if the amount is under desired number, then output somehing with results? Or even go to straight to the only one article if the amount is 1?

Offline

#2 2008-04-22 11:54:47

wet
Developer Emeritus
From: Schoerfling, Austria
Registered: 2005-06-06
Posts: 3,330
Website Mastodon

Re: If search results amount is smaller than X, then do something

Since Textpattern 4.0.6, you can do something like this with txp:if_search_results:

<txp:if_search_results min="2">
    got two or more search results
<txp:else />
    got zero or one search result
</txp:if_search_results>

Offline

#3 2008-04-22 13:28:22

ultramega
Member
Registered: 2006-02-26
Posts: 221

Re: If search results amount is smaller than X, then do something

Great, thanks for the info!

Offline

Board footer

Powered by FluxBB