Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Using if_article_section with multiple sections
I have an article form, used to list the contents of a section. The form is called from the page using:
<code><txp:article sortby=“Posted” sortdir=“desc” form=“article_index_1” limit=“6” /></code><br>
And there is a conditional within the form article_index_1 to treat different sections separately:
<code>
<txp:if_article_section name=“Help”>
(print a headline one way)
<txp:else />
(print a headline a different way)
</txp:if_article_section>
</code><br>
The above works perfectly, as long as only one section is specified. However, when I specify two sections like this:
<code>
<txp:if_article_section name=“Help,Discounts”>
(print a headline one way)
<txp:else />
(print a headline a different way)
</txp:if_article_section>
</code><br>
The conditional is never met (printing only the different way), even when the section is Help or Discounts.
The syntax appears correct as of here, and I’ve tried slight variations – leaving spaces after the comma, for example. Any ideas ? Could it be a bug ?
~Nick
Last edited by NickML (2006-07-21 14:11:43)
Offline
#2 2006-07-21 20:23:04
- els
- Moderator

- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: Using if_article_section with multiple sections
I always thought that if_article_section doesn’t take multiple values for ‘name’ (unlike if_section).
Offline
Re: Using if_article_section with multiple sections
That’s certainly one explanation, although the Textbook wiki appears to think otherwise. It’s a shame if it’s the case – I think there are eight different sections using two different styles on the same script, and it’ll now need eight sets of conditional tags.
~Nick
Offline
#4 2006-07-21 20:45:53
- els
- Moderator

- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: Using if_article_section with multiple sections
It looks like it’s on it’s way :)
Offline