My client wants to hold its PDF documents library for reference and easy-always-wherever access. The problem is that the library holds more than a thousand study documents. It's impossible to manually create an entry for each document, so I was wondering if there's a simpler way to just create a list of links for every document in a specific folder.

Notice that the "entries" won't have a link to a special page, or comments, description, don't need to show creation date or any other metadata. It would be sufficient with just a link to the PDF and that's it.


You could also achieve this using the Files module and File Entries tags. The Files module works much like Entries but you don't have to create them. Simply create an upload directory and put the files in there. Then sync the directory. To add a file to the directory you can use the File upload feature of the CP.


You could use Channel Files or Assets and have all of those documents attached to 1 single entry.

Avoid using raw PHP in templates. If you must use PHP, extract it to a plugin.


It can be possible with the PHP code within the template. Just create a template with "Allow PHP?" as "Yes" and use following code example:

$library_dir = "/library/directory/path/";

$pdfs = glob($library_dir . "*.pdf");

foreach($pdfs as $pdf)
    echo "<a href='[YOUR SITE URL]".$pdf."'>".$pdf."</a><br />";

I hope, it would help you.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.