Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#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
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