Skip to main content

r:get_file

<r:get_file />

Target a certain file by its ID. This tag is most often used within a loop.

This tag is useful for pulling files into a different page or feed on your site (likely in tandem with r:each), among many other uses.

ATTRIBUTE OPTIONS

Hover over the thumbnail preview in Files to get a file's ID

id="1234" - The ID of the file you would like to target. The ID can be found by going to Files and hovering over the thumbnail preview in Files to get a file's ID. You can also get this programatically via a loop.

Example:

<r:get_file id="1234">
  <r:file:name />
</r:get_file>

Or, perhaps you want to use it in an XML feed for the Staff Council theme:

<r:set_var name="imgID">
    <r:select_html_attr css_selector="img" attr="data-asset-id">
        <r:page:content name="wvu-profile__photo" />
    </r:select_html_attr>
</r:set_var>

<image_url>
    <r:get_file id="{$imgID}">
        <r:file:download_url />
    </r:get_file>
</image_url>

get_file

Target a certain file by its ID.

Attribute options

Hover over the thumbnail preview in Files to get a file's ID

This filter doesn't have any options, but you must pass it a file's ID.

Example:

{% assign myFile = site | get_file: 1234 %} <!-- 👈 Change to your file's ID -->
<p><a download href="{{ myFile.download_url }}">Download {{ myFile.title }}</a></p>

Find out the available drops on the r:file page.

Last updated on October 10, 2022.

We welcome all questions, feedback and bug reports. If you're having an issue, we usually need the following information:

  • A brief description of the issue
  • A link to the page where you saw the issue
  • Screenshots that illustrate the problem - How do I take a screenshot?

Kindly email CleanSlate@mail.wvu.edu for help or use the form on the request help page.