Answers.Body: <p>Assuming the field where your client can select the download is an asset field, you can use the following:</p>
  
  <pre><code>{% 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 %}
  </code></pre>
  
  <p>Replacing <code>block.download</code> with the name of your field.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-10-09T10:44:47.257Z
Answers.LastActivityDate: 2014-10-09T10:44:47.257Z
Answers.UserDisplayName: Jamie Wade
Answers.Body: <p>I'm assuming that your PDF field is an assets field? If so, it works exactly the same way as images, and you can output it using something like this:</p>
  
  <pre><code>{% for block in entry.matrixFieldHandle %}
      {% set pdf = block.pdfFieldHandle.first() %}
      &lt;a href="{{pdf.getUrl}}"&gt;Text&lt;/a&gt;
  {% endfor %}`
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-10-09T20:27:54.137Z
Answers.Text: Thanks for editing Brandon; for some reason the 4-space indent just wasn't turning it into code earlier!
Answers.UserDisplayName: darylknight
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-10-09T10:42:58.433Z
Answers.LastActivityDate: 2014-10-09T17:06:47.260Z
Answers.LastEditDate: 2014-10-09T17:06:47.260Z
Answers.UserDisplayName: darylknight
Body: <p>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.</p>
  
  <p>Here is the code:</p>
  
  <pre class="lang-twig prettyprint-override"><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 %}
  </code></pre>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2014-10-09T17:06:05.853Z
Comments.Text: Hi Brett, welcome to the Craft Stack Exchange site! I’ve edited your question a bit to make it more clear, and removed your second question about creating a Blog. Please post that as a separate question so it can have its own direct set of answers.
Comments.UserDisplayName: Brandon Kelly
Tags: <matrix><blocks>
Title: How do I output a file’s URL in a Matrix field?
ThreadText: # How do I output a file’s URL in a Matrix field?
  
  (Asked by: username_0 on 2014-10-09)
  
  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:
  
  ```twig
  {% for block in entry.seriesInformation %}
      {% if block.type == "bladeImage" %}
  
          {% set image = block.image.first() %}
  
          {% if image %}
              <img src="{{ image.getUrl('bladesdetail') }}" width="{{ image.getWidth('bladesdetail') }}" height="{{ image.getHeight('bladesdetail') }}" alt="{{ image.title }}">
          {% endif %}
  
      {% elseif block.type == "caption" %}
  
          {{ block.caption }}
  
      {% elseif block.type == "bladeBrochure" %}
  
          <p><a href="{{ bladeBrochure.url }}">Download &rarr;</a></p>
  
      {% endif %}
  {% endfor %}
  
  ```
  
  **Tags:** matrix, blocks
  
  > **Comments:**
  > **username_1**: Hi username_0, welcome to the Craft Stack Exchange site! I’ve edited your question a bit to make it more clear, and removed your second question about creating a Blog. Please post that as a separate question so it can have its own direct set of answers.  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_2 on 2014-10-09. Score: 6
  
  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 %}
          <a href="{{ download.url }}">Click me to download</a>
      {% endif %}
  
  ```
  
  Replacing `block.download` with the name of your field.
  
  
  ---
  
  ### Answer by username_3 on 2014-10-09. Score: 5
  
  I'm assuming that your PDF field is an assets field? If so, it works exactly the same way as images, and you can output it using something like this:
  
  ```
  {% for block in entry.matrixFieldHandle %}
      {% set pdf = block.pdfFieldHandle.first() %}
      <a href="{{pdf.getUrl}}">Text</a>
  {% endfor %}`
  
  ```
  
  > **Comments:**
  > **username_3**: Thanks for editing username_1; for some reason the 4-space indent just wasn't turning it into code earlier!  
  
  ---
  
  