I am setting up the news module and wanting to add a PDF file for download using a custom Field Definition.
Desired result is:
Content editor can upload PDF file for frontend download when publishing a news item.
Article displays linked file name and file size for polite user experience.
I know there are many forum posts about offering files instead of the default image handling only. Unfortunately nothing that I can get working or really understand at this stage. I have found the UDT for filesize which looks perfect for the job.
Question is, is there/tag a way to auto populate the link (file=) and name (name=) even tho they are already within a UDT tag?
Code: Select all
{if $field->type == 'file'}
Download attachment:
<a class="pdf" href="{$entry->file_location}/{$field->value}">{filelink file='uploads/news/id2' name='Grab Name of File'}
</a>
{/if}