How to add link to card image?

Hi,

I would like to make CERN cards not only clickable on the title but also on the main image. After some research i found this post explaining how to make an image clickable from a view.

I followed the procedure :

  1. Adding a new URL field to my content type
  2. Adding this field to the view and excluding it from display
  3. Editing the image field in order to output this field as a link (in this case a token)

I encounter two problems :

  1. I can’t find the token of the URL i previously created
  2. Even when inserting a random token such as [site:url], the image are still not clickable.

On the page in question, i would like to implement it for the regular cards in a block view and also for the article box content type.

Do you guys have any idea ?

Thank you.

Maxime

Hey Maxime,

The cards have their own functionality, which you cannot override from the view. In other words the card display “hijacks” the default functionality of how each node should appear on the view.

The only way to change the card, you have to override the pattern in CERN Components module, which we not recommend.

By the way, we have in our near plans to make the whole cards clickable, not only the title (its annoying for me too).

Kostas

Hey,

Ah nice, then we can probably wait for that change.

Thank you for your help.

Maxime

Hello,
I tried to put the listing title field of the news page or resource page content types into the link field of the card display instead of putting it into the title field and for me it works.


Jan

1 Like