Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Re: Associating images to links
experiment with using the link destination in the image “name” field (Julian)
A quick minor clarification: the link destination (URL) for each link is still managed/saved in the Links tab. The idea of filling in the link destination in the image “name” field is just to relate that image to a link that has exactly the same URL.
Offline
Re: Associating images to links
Thanks, Maniqui, I understand. I was just trying to be brief. :)
Bloke wrote:
Or, if one of the output streams is XML… :-)
Hmm. Something else to look at closer.
Last edited by Destry (2010-01-22 13:21:13)
Offline
#15 2010-02-11 05:48:45
- pauldice
- New Member
- Registered: 2010-02-11
- Posts: 6
Re: Associating images to links
Apologies for resurrecting this thread but I’m new to TXP and this is one of the first things I wanted to do: display a list of images that are links to external sites. It’s such a common feature on websites that I was surprised it wasn’t easier to do and thought I might be missing something…
I initially planned to use the link’s Sort Value to hold the corresponding image id but then discovered that there is no way to retrieve the Sort Value field. So I ended up setting the link Title to be the same as the Image Name and outputting the links with a form like this:
<a href="<txp:link_url />" target="_blank" title="<txp:link_description />"><txp:image name='<txp:link_name />' /></a>
It works but feels very much like a hack. An image id field for links would be much more elegant. Is there a way to request one or see if one is on the cards?
Offline