Page 1 of 1

Upload files to page when opening page

Posted: Thu May 28, 2020 6:58 am
by Barrowboy
Cmsms 2.2.12

Assuming there is not already a method, could someone assist in trying to do the following.

I want to populate a page with a list of PDF files located in a folder and then create a list of titles in a page with each item linked to the PDF doc but to do it automatically from a template or module. using the file name.

Then if another file was uploaded to the folder, it would automatically have a title and a link generated on the page.

I know this could be done manually but would like to find away to do it automatically.

Thanks

Re: Upload files to page when opening page

Posted: Thu May 28, 2020 9:20 am
by velden
Check the template in this post for an example.
viewtopic.php?p=327881#p327881

I'm not sure glob is allowed by default.
Else check:
https://docs.cmsmadesimple.org/configur ... ive_smarty

Re: Upload files to page when opening page

Posted: Fri May 29, 2020 6:26 am
by Barrowboy
Thanks for your reply, we know have something very close to working.

But the links on the page are showing the root of the directory.

uploads/myfiles/pdfs

could you please explain how we can use "strip" to remove the directory path.

Thanks

Re: Upload files to page when opening page

Posted: Fri May 29, 2020 1:25 pm
by Barrowboy
Hi
We regard to my previous question I may have missled what I meant.

What I would like to find is a method to hide the begining of the link.

The link reads
uploads/myfiles/pdfs Meetings Agenda.pdf

Would like to hide uploads/myfiles/pdfs

Just leave the document title Meetings Agenda.pdf

I trust someone can suggest a method.

Thanks

Re: Upload files to page when opening page

Posted: Fri May 29, 2020 2:18 pm
by velden

Code: Select all

{$yourVariable|replace:'uploads/myfiles/pdfs':''}