We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 37913
    • 9 Posts
    I wonder if anyone can help me to think about how to come up with a long-term solution to a problem that I've developed over time.

    My website offers lots of PDF documents for download. Originally there were only meant to be a few dozen, in English. Over time it's ended up being over 100, in over 40 languages = 1000's of documents overall.

    Documents are stored on Amazon S3 so I can use the Cloudfront CDN. Path names look like:
    http://media.mydomain.com/english/document1_en.pdf
    http://media.mydomain.com/german/document1_de.pdf

    For each document I have to make all the download links manually. I make a chunk containing a <ul> so that I can re-use the chunk in multiple places:
    <ul>
    <li><a href="">Document 1 - English</a></li>
    <li><a href="">Document 1 - German</a></li>
    <li> ... </li>
    </ul>

    The problem is that it takes me ages make all the download-link-chunks, and if Modx cloud gets a CDN that I can use I'll have to rename all these links...

    So my questions is: Is there any way of collating these download links automatically?

    Solutions I wondered about:
    1) Some way of Modx reading the contents of my directory on Amazon S3 and automatically creating a <ul> based on the contents
    2) Creating a static resource for each PDF - maybe in a directory for each document - then using GetResources to read off the documents for each directory.

    Any suggestions really welcome. Thanks, Mat [ed. note: thewoo last edited this post 9 years, 10 months ago.]