Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Re: flexibility of TXP links?
rethinking my suggestion, i’m not certain whether the conditional should be for the url or the image field… I guess it depends on each user.
Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Offline
Re: flexibility of TXP links?
Eliot – the code you have there looks incorrect to me. I think it shoud read:-
<txp:if_custom_field name="url"><a href="<txp:custom_field name="url" />"><img src="<txp:custom_field name="image" />" /></a></txp:if_custom_field>
Last edited by thebombsite (2008-01-17 13:32:16)
Stuart
In a Time of Universal Deceit
Telling the Truth is Revolutionary.
Offline
Re: flexibility of TXP links?
Nice catch stuart,
Forgot the txp…:)
Corrected it in the original post to prevent others using it wrongly.
Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Offline
Re: flexibility of TXP links?
hmm i tried out the updated example, and now i have nothing. i have a custom field called url which i’m filling in on my article’s sidebar, the page has this command in it; <txp:article form=“custom-link” pgonly=“0” />
and the custom link form looks like;
<txp:if_custom_field name=“url”><a href=”<txp:custom_field name=“url” />”><img src=”<txp:custom_field name=“image” />” /></a></txp:if_custom_field>
does it have something to do with the fact that i don’t have an image custom field in my preferences?
well thanks again for the help so far – as usual it’s very appreciated.
Offline
Re: flexibility of TXP links?
Actually, I have used the article image field on the article, so I call that using <txp:article_image /> rather than a custom field holding details of the image.
To troubleshoot, check the HTML source being sent to the browser and try to see what’s missing. If the code for the link is there, then it must be the “image” custom field causing the problems.
Offline
Re: flexibility of TXP links?
mrtunes wrote:
does it have something to do with the fact that i don’t have an image custom field in my preferences?
Yes, For the code to work you need a custom field named url and another one named image
Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Offline