Jump to content

Centralized File management


bubu2110
 Share

Recommended Posts

Hey guys,

I have a bunch of PDF files.

Page 1
- Link to a.pdf
- Link to b.pdf

Page 2
- Link to a.pdf
- Link to c.pdf

Is there a simple way, that I don´t have to upload a.pdf multiple times? My favorized way would be to upload all the files at one destination and select them from a list when I want to use them on my pages. Also it would be great if I could replace a.pdf to a-new.pdf

Do you know a Module or a nice workaround?

Thanks in advance

bubu

  • Like 1
Link to comment
Share on other sites

You could take all files at one hidden place like

parent ->pdf-files
   child  ->a.pdf
   child ->b.pdf

and on every page you want you can link via dialog to the files or make a file-inputfield with selector to the setup parent page with all childpages as choice.

I used at one project a pagetable field to have all files on one place - and can link to them from any other page.

there is a commercial module, too

and a free one with less functions but much to learn from

https://processwire.com/modules/media-library/

kind regards mr-fan

  • Like 3
Link to comment
Share on other sites

I've done this for a couple clients. @mr-fan suggestion is the one I use to. One installation I've done works like this:

Download Library Page (hidden, template = "downloads")
- File 1 (template = "download", contains a file upload field called 'pdf_file' 'and sometimes other fields such as 'title' etc.)
- File 2 (template = "download", as File 1)
- File 3 etc.

Then, create a "file_download" field on pages that need the files. This is a Page Reference field with parent page set to the Download Library page and the selector template="download".  I use a Page Select Multiple type for this.
In the page template you can then do this to get the files

foreach ($page->file_download as $fd) {
	echo "<a href='{$fd->url}'>{$fd->title}</a>
}

Hope that helps.

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...