Show specific HTML based on the number of results
This one's not directly product-specific, but I have the following problem bugging me for quite some time and noone seems to be able to solve it:
I want to show this simple jQuery-filter-module on my search results page, but only if there are 10 or more results:
http://pastie.org/4271952
Now, I can't put it inside of the channel_entries or low_search:results tags, because then it will be repeated with each entry.
Of course it wouldn't be a real problem, if the module was there all the time, but in the case of no_results, it's not only inelegant to have it show up, but it messes up my DOM-tree.
So, does anybody now how to show this module based on the number of entries or at least, if there are any entries at all?
Replies
Low 17 Jul 2012 14:33
Couldn't you just put it in the channel:entries or low_search:results tag and use a conditional? Something like:
Heiko 17 Jul 2012 15:06
Man, you are such a life saver, I'll buy every friggin' addon just to support you! ;)
It seems I didn't know about the count == 1-"stuff" and it works perfectly!
Thanks again!