Wrap a field in a link conditionally in views I'm quite new to Drupal but I've been a developer for a few years. I'm struggling with what should be a very simple task. I have created a field 'field_client_link' that authors can use to enter a url to a portfolio content type about a client. If an author has entered a link I want to wrap a client logo in it, otherwise just display the image. I'm sure this is not as hard as I'm making it out to be. In WordPress I would just write something like this and be done with it: 

&lt;?php 

    if (get_field('link')) {
        echo '&lt;a href="' . get_field('link') . '"&gt;' . get_field('image') . '&lt;/a&gt;';
    } else {
        echo get_field('image');
    }

?&gt;


Here are my settings. I've set the link to be hidden because I don't want it outputting until I call it later. Hoping you can help me:
There's a lightweight module that lets you attach a custom link to any image using the image formatter setting: Image Link Formatter

It will automatically detect any link field and make it an option to set that link for the image.

I usually just go this route instead of dealing with tokens or template modifications every time I want to link an image.