Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#1 2009-02-26 21:25:10
- bmsorg
- New Member
- Registered: 2009-02-25
- Posts: 7
Permlink as condition of whether any values exist in article Body
I am outputting articles as a product listing. Some of the products have product info in the Body of the article, while some don’t. In my listing of the products/articles, I want the products titles that have content in the Body field to permlink to themselves (this is easy, obviously) while the products that do not have any content to just appear as text, not permlinking to themselves.
Is there some way in my form that will be used to output these articles listings, to say…
if this article has nothing in the body, do not permlink to this title,
while if this article has anything in the value, permlink to this title
Thanks!
Offline
Re: Permlink as condition of whether any values exist in article Body
<txp:variable name="has_body" value='<txp:body />' />
<txp:if_variable name="has_body" value="">
<txp:title />
<txp:else />
<txp:permlink><txp:title /></txp:permlink>
</txp:if_variable>
Offline
#3 2009-02-26 22:02:11
- bmsorg
- New Member
- Registered: 2009-02-25
- Posts: 7
Re: Permlink as condition of whether any values exist in article Body
Thanks so much. I never really understood the variable tag, and this opens up a lot of ideas now.
Cheers! Brandon
Offline