Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
What if there isn't an article?
I want to list articles from a different section on a page of a specific category. I can do this, but what I can’t figure out is how to have a ‘no articles available’ message if there are none.
Any ideas?
Thanks.
Loz
Offline
Offline
#3 2008-04-19 18:51:52
- masa
- Member
- From: Asturias, Spain
- Registered: 2005-11-25
- Posts: 1,091
Re: What if there isn't an article?
Yes, the plugin Jukka pointed out will do what you want.
To elaborate on this, here’s a sample:
<txp:chh_if_data>
<txp:article form="property_listing" sort="Category1 desc, Category2 asc" limit="5" />
<txp:else />
<p>Sorry, there are currently no properties listed in the selected price range.</p>
</txp:chh_if_data>
I use this code on a property site to display a message, if there are currently no properties listed in the category chosen by the visitor.
Offline
#4 2008-04-19 19:13:26
- masa
- Member
- From: Asturias, Spain
- Registered: 2005-11-25
- Posts: 1,091
Re: What if there isn't an article?
On second thought, you might also find cbs_category_list helpful.
It will only list categories that contain any articles, not empty ones.
Offline
Offline
Pages: 1