Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#13 2010-01-22 12:12:40

maniqui
Member
From: Buenos Aires, Argentina
Registered: 2004-10-10
Posts: 3,070
Website

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.


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#14 2010-01-22 13:18:32

Destry
Member
From: Haut-Rhin
Registered: 2004-08-04
Posts: 4,912
Website

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

Board footer

Powered by FluxBB