Hey guys,

so I've just created a responsive grid layout using a view but now I want to add a different link to an image...
I'm not finding any option in the view to fix my problem...

Thanks !

Comments

mattys’s picture

please elaborate on "but now I want to add a different link to an image...", what exactly do you mean?

ASahil10’s picture

So e.g. if I click on the image it should redirect me to facebook and not to /node/46...

mattys’s picture

still not clear what you mean

do you have a link i can see this?

ASahil10’s picture

http://5.9.160.34/Faecher

So if click on the picture it redirects me to /node/465 but i want to link to facebook or any other external site...

mattys’s picture

i think i know what you mean, but if this is a one off, why use views?

the other method is to create a global custom text area and reference fields in there, then exclude the fields so hey don't show twice

ASahil10’s picture

No no it's not a one off actually this will be a responsive grid which will present every subject of our school...

ASahil10’s picture

I've already created a custom text area:

<div id="Fächer">
           <div class="body">
                                       <p><div class="Foto">{{ field_fachfoto }}</div></p> --------------thats the field for the image
                                       <div class="Name">{{ field_fachname }}</div>          -------------- thats a normal text field             
           </div>
</div>

ASahil10’s picture

And I want to link my image to a external site.... So if u click on the image u are not redirected to a content page in my drupal site but rather to an external page like facebook or google....

mattys’s picture

i think you need to add the link via the content type, so add when adding a node, then reference the link, something like:

<p><div class="Foto"><a href="{{ field_fachfoto link }}">{{ field_fachfoto }}</a></div></p>

I've not added a link ref to a href before, so not sure how it will work, but am sure with something tweaking and patience you should be able to do it

mattys’s picture

also think about maybe using views themes to achieve this, as per https://drupal.stackexchange.com/questions/106687/how-to-add-link-intern...