Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#1 2009-09-19 00:45:58
- kewlboyee
- New Member
- Registered: 2009-09-18
- Posts: 4
How do I NOT output a form when a specific article is displayed?
Yes, I am a newb. So, I want this form “kmc_secondary_courses” to be outputted in all cases except when a specific article is being displayed. Here is the code for the page template:
<!— content —>
<div id=“content”>
<txp:output_form form=“kmc_secondary_courses” />
<div id=“content_primary”> <txp:if_individual_article> <txp:article status=“sticky” /> <txp:article /> <txp:else /> <txp:article status=“sticky” /> </txp:if_individual_article> </div><txp:output_form form=“kmc_content_features” />
</div><!— / #content —>
I could make that article have a special category and use <txp:if_article_category name=”???”> but I still can’t figure it out since the form is outputted before the article.
Thanks.
Offline
Re: How do I NOT output a form when a specific article is displayed?
Wrap it on <txp:if_article_id id="XX"></txp:if_article_id>
, where XX
is the number (id) corresponding to the article where you don’t want to display the form.
Last edited by maniqui (2009-09-19 01:22:07)
Offline
#3 2009-09-22 00:43:08
- kewlboyee
- New Member
- Registered: 2009-09-18
- Posts: 4
Re: How do I NOT output a form when a specific article is displayed?
So you mean like this?
<!— content —>
<div id=“content”>
<txp:if_article_id id“250”>
<txp:output_form form=“kmc_secondary_courses” />
</txp:if_article_id>
<txp:output_form form=“kmc_content_features” />
</div><!— / #content —>
Because that does the opposite, that outputs the form ONLY for the article with the ID=“250”. Am I missing something?
Offline
Re: How do I NOT output a form when a specific article is displayed?
Almost there:
<txp:if_article_id id="250">
<txp:else />
<txp:output_form form="kmc_secondary_courses" />
</txp:if_article_id>
Offline
#5 2009-09-22 00:53:32
- kewlboyee
- New Member
- Registered: 2009-09-18
- Posts: 4
Re: How do I NOT output a form when a specific article is displayed?
Thanks! But, for some reason now the form is not output at all.
Offline
Re: How do I NOT output a form when a specific article is displayed?
Ops.
If you have copied the code from my post above, then the problem is that I wrongly used typographical (curly) quotes on attributes, and that’s probably the reason you were getting no output at all.
I’ve fixed the code above, try it again.
Offline
#7 2009-09-22 01:11:11
- kewlboyee
- New Member
- Registered: 2009-09-18
- Posts: 4
Re: How do I NOT output a form when a specific article is displayed?
Yay, that worked. Thanks so much!
Offline