154 Posts
WebOne
10 years ago
2
Topic

I have an image field and a separate link field in the FORM. I want to show the image in the List but it must link to the value entered into the LINK field (using a link plugin). What option or additional link plugin should I use in the dropdown? Or is there a better way of doing this (without editing the template) ?

Get a Book for SEBLOD
10 years ago
0
Level 1

Hi webone,

You can use for that the typography plugin "HTML" by clicking on button "2".

When you select option "HTML" for the link field, click on button "+". In the textarea try to fill the following code:

<a href="/$cck->getValue('name_of_field_link')" class=""><img src="/$cck->getValue('name_of_an_image_field')" title="" alt=""></a>

Do not forget to move an image field to a "hidden" position.

Regards,
Mehdi

4229 Posts
Kadministrator
10 years ago
0
Level 1

Just small modification of Mehdi's code - if I remember correctly you need to use

$cck->getLink('name_of_field_link')

to get Link fields link.

Get a Book for SEBLOD