Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
#1 2007-10-12 16:28:22
- brianlux0r
- Member
- Registered: 2007-06-04
- Posts: 41
problem with <txp:if_article_id id=3>
Hi trying to include a misc form if a certain article is being pulled:
placed in default page (section uses this as template:
<txp:if_article_id id=3>
<txp:article limit=“1” form=“b-form” />
</txp:if_article_id>
this doesnt output anything! what am i doing wrong?
Offline
#2 2007-10-12 17:23:04
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: problem with <txp:if_article_id id=3>
brianlux0r wrote:
<txp:article limit="1" form="b-form" />
If it’s a misc form you need to use <tpx:output_form />
. Also wrap it in if_individual_article tags:
<txp:if_individual_article>
<txp:if_article_id id="3">
<txp:output_form form="b-form" />
</txp:if_article_id>
</txp:if_individual_article>
Offline
#3 2007-10-25 18:18:17
- brianlux0r
- Member
- Registered: 2007-06-04
- Posts: 41
Re: problem with <txp:if_article_id id=3>
ok i realized that if im calling just section url, althought im pulling a certain article with limit 1 for the particular section, my condition is not meeting for if article id = something, this will not work on a section page. how can i display a certain form based on the section, without having to create a new template page for only that section?
Offline
Offline
#5 2007-10-26 16:50:26
- brianlux0r
- Member
- Registered: 2007-06-04
- Posts: 41
Re: problem with <txp:if_article_id id=3>
ok i have section-1 using default template. now section-1 uses article 3 for it’s content.
So when i call site.com/section-1 the form i want to be loaded based on the article id if, it is not loading:
inside default template i have:
<txp:if_individual_article>
<txp:if_article_id id=“3”>
<txp:output_form form=“b-form” />
</txp:if_article_id>
</txp:if_individual_article>
Offline
#6 2007-10-30 03:37:26
- Mary
- Sock Enthusiast
- Registered: 2004-06-27
- Posts: 6,236
Re: problem with <txp:if_article_id id=3>
That’s not an individual article page, so the article ID is never even checked. Also, on a non-individual article page, you have to put article related tags (including conditionals) inside an article form.
Offline
#7 2007-10-30 06:10:40
- brianlux0r
- Member
- Registered: 2007-06-04
- Posts: 41
Re: problem with <txp:if_article_id id=3>
yeah i was looking at it the wrong way. i cant access article data only from a section template file.
Offline
Re: problem with <txp:if_article_id id=3>
Is there a “if_article_id_less_than” available somewhere? As a plugin maybe?
Offline
Offline
Re: problem with <txp:if_article_id id=3>
Thanx Gocom. I guess that’s what I’ll have to do. I was more looking for a way to display the excerpt field if show articles below a certain id (which has the excerpt in the body too) and just show the body for them. Using echo would (I guess) require adding extra queries. Or is the excerpt stored in the $thisarticle context at this point maybe?
Offline
#11 2007-12-06 04:56:06
- Mary
- Sock Enthusiast
- Registered: 2004-06-27
- Posts: 6,236
Re: problem with <txp:if_article_id id=3>
Nope, no extra queries. Just call excerpt(array())
(all Txp tags are functions).
Offline
Pages: 1