What is the proper way to include a file attachment in a content_item, and then link to that file in a page template?
For example – I have a Resource content_type. Each Resource content_item is associated with a PDF file. Rather than have a user load a PDF file separately, then reference its file-name within the Resource content_item, I want to allow them to attach the PDF to the Resource item itself. This will also keep things neater inside the CMS, as my users tend to place random files all over the place.
The problem is … I have no idea how to access information about that attached PDF file in the Resource content_item’s template – I don’t know where it resides on the server, I don’t know its filename, etc. I try using variations of $rx.generate.location … but that doesn’t seem to work when you’re dealing with a file stored in an attribute of another content_item, rather than it being its own content_item itself.
Is there a standard way of approaching this problem? Or is it better to upload the PDF as a separate file, and then reference it in the item in some other way, such as a string attribute that must be entered manually (a slot is a no-go, b/c my users are not capable of dealing with Active Assembly)?