<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Alex van der Valk</title>
    <description>The latest articles on DEV Community by Alex van der Valk (@alexvdvalk).</description>
    <link>https://dev.to/alexvdvalk</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F302560%2Fa3a4c33c-58d7-4efb-9214-617bd593fda8.jpeg</url>
      <title>DEV Community: Alex van der Valk</title>
      <link>https://dev.to/alexvdvalk</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/alexvdvalk"/>
    <language>en</language>
    <item>
      <title>Previewing Files With Google Docs Previews</title>
      <dc:creator>Alex van der Valk</dc:creator>
      <pubDate>Thu, 24 Aug 2023 12:17:28 +0000</pubDate>
      <link>https://dev.to/directus/previewing-files-with-google-docs-previews-29f6</link>
      <guid>https://dev.to/directus/previewing-files-with-google-docs-previews-29f6</guid>
      <description>&lt;p&gt;Using the file interface, you can store all types of files inside items in your Directus projects. However, there is no built-in way to preview files directly in the editor. I found an easy and reliable way to do this using Directus' Live Preview feature and Google Gview to preview many file formats without first having to download each file.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;In your collection, create a &lt;strong&gt;File&lt;/strong&gt; field. I recommend specifying a specific folder for the uploads here, because it can help keep your assets organized.&lt;/li&gt;
&lt;li&gt;Ensure you have a static access token with a user who has permission to view your folder of files.&lt;/li&gt;
&lt;li&gt;In your Collection configuration, scroll down to the &lt;strong&gt;Preview&lt;/strong&gt; section.&lt;/li&gt;
&lt;li&gt;In the &lt;strong&gt;Preview URL&lt;/strong&gt; field add the following, replacing &lt;code&gt;YOUR_DIRECTUS_URL&lt;/code&gt; with the URL for your Directus Project, and &lt;code&gt;TOKEN&lt;/code&gt; with your static token.
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    https://docs.google.com/gview?embedded=true&amp;amp;url=YOUR_DIRECTUS_URL/assets/?access_token=TOKEN
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Using the variable tool in the &lt;strong&gt;Preview URL&lt;/strong&gt; interface, add in the image &lt;code&gt;ID&lt;/code&gt; just before the &lt;code&gt;?&lt;/code&gt; character in the URL.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--bYCmB-lx--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://marketing.directus.app/assets/7debe0c6-c0b2-43ab-82d8-e510cacb451e" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--bYCmB-lx--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://marketing.directus.app/assets/7debe0c6-c0b2-43ab-82d8-e510cacb451e" alt="Using the plus button to the right of the text box presents all fields within the candidate collection. Select ID with the cursor positioned just before the question mark." width="600" height="291"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Open up a record in your collection and select the &lt;strong&gt;Live Preview&lt;/strong&gt; button in the top-right. Now you can preview the file inside Directus without having to download it first!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--nAQfnQID--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://marketing.directus.app/assets/0012d977-198d-42de-8421-ad87c0f405b4" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--nAQfnQID--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://marketing.directus.app/assets/0012d977-198d-42de-8421-ad87c0f405b4" alt="Directus Editor with a form on the left and a Doc X file being previewed on the right." width="800" height="479"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>directus</category>
    </item>
  </channel>
</rss>
