""

Linking a CTA button to a document

5 min read
The article shows how to add an URL to a CTA button, useful if linking to a PDF or document

Locating the URL from a document in the Drupal media library

Navigate to the media library by going to Content > Media
Filter by type to show only the type of media content you want - file or image
Use the search feature to find the specifc file you wish to use

""

When you have found the file you wish to link to click on the file to open it

Hover over the file link and right click and choose Copy Link Address

The link address will look something like this - https://www.euromaid.com/sites/g/files/emiian466/files/2021-06/ecck64_specsheet.pdf

Remove the first section of the url as it deals with an "absolute" location. We want to leave the part of the address that has a relative location, ie. its position to the other files that make up the website. The benefit is that it doesnt matter if the first part of the address ever changes, the file will still remain in the correct position relative to the other files that make up the structure of the website.

We will be left with this address -  /files/2021-06/ecck64_specsheet.pdf

""

Paste the shortened URL into the URL field on any component that accepts an URL

Label the CTA button as usual. 

Ensure there are no spaces before the first forward slash / or you will encounter an error when you try to save.

Click save

""