Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#13 2008-01-17 12:53:41

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,091
Website GitHub Mastodon Twitter

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

#14 2008-01-17 13:31:38

thebombsite
Archived Plugin Author
From: Exmouth, England
Registered: 2004-08-24
Posts: 3,251
Website

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

#15 2008-01-17 14:22:35

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,091
Website GitHub Mastodon Twitter

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

#16 2008-01-17 17:22:17

mrtunes
Member
From: Toronto, On
Registered: 2007-03-12
Posts: 575
Website

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

#17 2008-01-18 08:24:45

aslsw66
Member
From: Canberra, Australia
Registered: 2004-08-04
Posts: 342
Website

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

#18 2008-01-18 09:13:33

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,091
Website GitHub Mastodon Twitter

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

Board footer

Powered by FluxBB