title: Display Extbase FileReference with Fluid
body: <p>In an extbase extension, I have a FileReference Object. It was created with extension_builder originally.
  From The Model:</p>
  
  <pre><code>/**
   * apprenticeshipDocument
   *
   @var \TYPO3\CMS\Extbase\Domain\Model\FileReference
   */
  protected $apprenticeshipDocument = NULL;
  </code></pre>
  
  <p>etc.</p>
  
  <p>In the frontend, <code>&lt;f:debug&gt;{institution.apprenticeshipDocument}&lt;/f:debug&gt;</code> gives me this:</p>
  
  <p><img src="https://i.stack.imgur.com/kHwgO.png" alt="Extbase Var Dump"></p>
  
  <p>First Thing: <code>originalResource</code> is missing.</p>
  
  <p>Second: When calling {institution.apprenticeshipDocument.uidLocal} directly, the value is NULL! Although it's said to be 450 above.</p>
  
  <p>Third: Let's say we could get uidLocal, which corresponds to the uid in sys_file.</p>
  
  <p>The googlable solution:</p>
  
  <pre><code>&lt;f:link.page pageUid="{f:uri.image(src:450)}" target="_blank"&gt;Text&lt;/f:link.page&gt;
  </code></pre>
  
  <p>doesn't point to the PDF file itself, but to a rendered GIF of the PDF.
  All I want to do is output the path to the file (<code>sys_file.identifier</code>) in a link... there must be a way, mustn't it?</p>
  
  <p>EDIT: Solution provided by Jost:</p>
  
  <pre><code>&lt;f:if condition="{institution.apprenticeshipDocument}"&gt;
      &lt;li&gt;
      &lt;f:link.page pageUid="{institution.apprenticeshipDocument.originalResource.publicUrl}" target="_blank"&gt;Text&lt;/f:link.page&gt;
      &lt;/li&gt;
  &lt;/f:if&gt;
  </code></pre>