Hi, Sorry for the delayed response
compute the directory and filename of the file(s) to be downloaded based on the name of the document (or any other field, including a TV)
I’d say what you stated there pretty much sums it up, but applied to a template in a Ditto call, where placeholder/tv [+supporting-document+] would automatically add the supported doc for that given property.
Obviously the documents would need a strict naming system, ie the same as the [+pagetitle+] and located in the /assets/files/ directory.
That way any script would just look at [+pagetitle+] and automatically search for the same name as either .doc, .docx or .pdf in the correct place, and render the document link depending on whether there is a supporting document.
This could be given a conditional - via PHx possibly - and the document link only appear if there is a supporting document.
That’s the logic, but I couldn’t write it in php! - unless the whole sounds feasible via simply a PHx statement ...
Thanks