In my matrix field, I want to be able to upload my image, and then upload another asset (in this case it would be a document) so that that image I upload links to that document.
I have my Matrix field setup like so:
Image -> -Image -linkedDocument
How can I set up a conditional where only add in the tag if I add an asset there?
Here is my relevant code:
% elseif block.type == "image" %}
{% set image = block.image.first() %}
{% if image %}
<a href="{{ image.linkedDocument }}"><img src="{{ image.getUrl('thumb') }}" width="{{ image.getWidth('thumb') }}" height="{{ image.getHeight('thumb') }}" alt="{{ image.title }}"></a>
{% endif %}
{% endif %}