Download / file links in Writer

Hi all - I have a client asking about adding download links into the Writer field. I know this is an active issue on Nolt at the moment, but for now what is the best approach? My solution up to now is:

  • Have a files section on the page for them to add files to, which includes a download link column:
  type: files
  label: Files
  layout: table
        label: Download link
        value: "{{ file.permalink }}"
  • Include instructions on the page that to add a download link to a Writer field they need to copy this, and then paste it into the link dialog in Writer.

This is working ok, but it would be cool to know if anyone has a better approach than this.

1 Like

Hello! Thank you for your solution, @mikeharrison, will use it like that!
But still it would be awesome to have an easier way for file handling for clients like having a file select menu in the link dialog f.e. I would think that is a quite common use case to add a pdf into a writer field?

Besides there are two things not really working well with this solution

  • {{ file.permalink }}, {{ file.previewUrl }} or {{ file.url }} give all an absolute url, so you have to take care of it in different environments like local and production … is it possible to get a relative path here? couldn’t find something
  • copy/pasting the link into the URL field of the link dialog somehow adds a space before it … so the link doesn’t work before deleting this space again … any idea why it adds this space? This is a nasty pitfall for clients.

This is an old thread, Kirby 4 has a file selector now, this is what you get when clicking on the link button and selecting File as link type. You can then navigate the site tree to select files.

Currently, you cannot limit the query regarding the pages to choose files from, this will come at a later date.

Awesome!! Thank you for the super fast reply. So I have to upgrade to version 4 then :+1: