Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
..output article id in a form
Ok something weird.. first of all, I know that there is article_id-tag :)
I’ve got a article and on that article page I’ve got a right div, which gets all its content from a misc form.
On that form there’s an if_individual_article-tag, which enables the different output to the right column depending on the page. Inside that tag is the related articles-tag and everything is ok until this point..
Then I’d like to output an image on the right column based on the custom field value, with some conditionals and stuff, but it all stops to the point where I’d need to get the article id so I could get some data. Inside that if_individual_article-tag it doesn’t output article_id, which I find very weird.. cos it does know what articles are related but doesn’t show the id :O
Outputting the article_id works on the left colum which gets its content based on article form template, but on the right colum that gets the content from misc form inside article form it doesn’t :/
I tried the globals id too but nothing either.. neither does the category1-tag output anything on that right column.
Last edited by tormu (2006-02-15 10:04:25)
Offline
Re: ..output article id in a form
You can put this code in the right column:
<code>
<txp:if_individual_article>
<txp:article form=“new_form”/>
</txp:if_individual_article>
</code>
Then create an article form called new_form where you can use the article_id.
The problem with this approach is that “new_form” also display the comments, so you need to turn off “auto-append comments to articles” in the preferences, and insert a <code><txp:output_form form=“comments_display” /></code> in your default article form.
Hope this helps.
Offline
Re: ..output article id in a form
Great, thanks! That does the trick :)
I don’t have commenting on that section of articles on at all so that isn’t a problem at all.. thanks again :)
Offline
#4 2006-02-15 16:34:38
- Mary
- Sock Enthusiast
- Registered: 2004-06-27
- Posts: 6,236
Re: ..output article id in a form
<txp:article_id />
Offline
Pages: 1