Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
if category empty?
Hi,
maybe a dumb question but how can I output some code (a list of articles of a section) only if a section is non-empty?
(I need it for this)
Diagnosis:
Version Textpattern: 4.0.3 (r1188)
PHP-Version: 4.4.1
Hosting: all-inkl.com
Offline
Re: if category empty?
I think if you create a form using “if_different” it will miss out empty sections so something like:-
<code>
<txp:if_different>
<txp:section />
</txp:if_different>
<li><txp:title /></li></code>
<br />
Then call it to your page template with <code><ul><txp:article_custom form=“formName” limit=“10” /></ul></code>. That will mix them up though so if you want some order to the sections you will need to use the section=“sectionName” attribute in the article_custom tag and have a tag for each section. I think that will do it. (There must be an easier way than that?)
Last edited by thebombsite (2006-04-10 21:06:34)
Stuart
In a Time of Universal Deceit
Telling the Truth is Revolutionary.
Offline
Re: if category empty?
hmmm…the blog is up and running so I don’t want to try it out on the running system.
but I will certainly consider this when developing something similar the next time. thanks!
Diagnosis:
Version Textpattern: 4.0.3 (r1188)
PHP-Version: 4.4.1
Hosting: all-inkl.com
Offline
#4 2006-04-11 14:01:58
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: if category empty?
Or use chh_if_data.
Offline
Pages: 1