How do I output a file’s URL in a Matrix field? I have a Matrix field with Image, Caption, and PDF sub-fields. I can output the Image and Caption fine, but am having no luck with the PDF file.

Here is the code:

{% for block in entry.seriesInformation %}
    {% if block.type == "bladeImage" %}

        {% set image = block.image.first() %}

        {% if image %}
            &lt;img src="{{ image.getUrl('bladesdetail') }}" width="{{ image.getWidth('bladesdetail') }}" height="{{ image.getHeight('bladesdetail') }}" alt="{{ image.title }}"&gt;
        {% endif %}

    {% elseif block.type == "caption" %}

        {{ block.caption }}

    {% elseif block.type == "bladeBrochure" %}

        &lt;p&gt;&lt;a href="{{ bladeBrochure.url }}"&gt;Download &amp;rarr;&lt;/a&gt;&lt;/p&gt;

    {% endif %}
{% endfor %}
Assuming the field where your client can select the download is an asset field, you can use the following:

{% elseif block.type == "bladeBrochure" %}
    {% set download = block.download.first() %}
    {% if download %}
        &lt;a href="{{ download.url }}"&gt;Click me to download&lt;/a&gt;
    {% endif %}


Replacing block.download with the name of your field.