Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2006-04-10 20:31:14

BZ
Member
From: Stuttgart, Germany
Registered: 2005-11-24
Posts: 65
Website

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

#2 2006-04-10 21:00:55

thebombsite
Archived Plugin Author
From: Exmouth, England
Registered: 2004-08-24
Posts: 3,251
Website

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

#3 2006-04-11 12:47:47

BZ
Member
From: Stuttgart, Germany
Registered: 2005-11-24
Posts: 65
Website

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

Board footer

Powered by FluxBB