Textpattern CMS support forum
- From: Cyprus
- Registered: 2004-11-20
- Posts: 6,911
I have a custom field which I would like it to respond to 3 different conditions.
- The field is empty for which case it links to our home page
- The field has a url for which case we link to it
- The field has a
#for which case I would like to show
I have constructed the code below which works, but is there a way using txp tags which I can achieve the same results in a more economical way?
<txp:if_custom_field name="url"> <txp:if_custom_field name="url" value="#"> <p>Off line</p> <txp:else /> <p><a rel="external" href="<txp:custom_field name="url" escape="" />">Website</a></p> </txp:if_custom_field> <txp:else /> <p><a href="<txp:site_url />" rel="home">Home</a></p> </txp:if_custom_field>