Enable PDF Downloads for Your CMS Item: Step-by-Step Guide
Tutorial: Enable PDF download for specific CMS item (step-by-step) ➜ Step 1 - Add an Embed Add an Embed element inside your CMS template or CMS Link Block. ➜ Step 2 - Insert the link HTML Paste this into the Embed and connect the CMS Attachment field to the attribute value: <a class="pdf-link" href="#" data-pdf-url="YOUR_PDF_ATTACHMENT_FIELD"></a> Replace YOUR_PDF_ATTACHMENT_FIELD with the actual CMS attachment field. ➜ Step 3 - Add a custom attribute Give the embed the attribute name you choose (example: data-pdf-url) so each item passes its own PDF URL. ➜ Step 4 - Paste the JavaScript Before the closing </body> tag, add this script to open the PDF in a new tab: <script> document.querySelectorAll('.pdf-link').forEach(function(link) { link.addEventListener('click', function(e) { e.preventDefault(); var pdfUrl = this.getAttribute('data-pdf-url'); window.open(pdfUrl, '_blank'); }); }); </script> ➜ Step 5 - Publish & test Publish the site and verify CMS item’s View PDF link opens its own attachment in a new tab.

