[pmwiki-users] Subfolders in "Uploads"? Esp. for Mini recipe

Petko Yotov 5ko at 5ko.fr
Tue Feb 2 16:44:08 CST 2010


On Tuesday 02 February 2010 18:04:02, Mike wrote :
> Basically, I'm trying to make the Mini recipe work with images clustered
> in subfolders - but all of the same PmWiki group. If possible, I'd also
> love to see subfolders for PmWiki attachments in general, but this would
> probably require a bit more reprogramming.
...
> > I was wondering if it is possible to organize uploads in the Uploads
> > directory in subdirectories, without using multiple groups.
> >
> > So, I'd like to use it like this:
> > uploads/Main/ - the "usual" uploads directory
> > uploads/Main/personal - contains personal pictures
> > uploads/Main/product1 - contains pictures of product 1
> > uploads/Main/product2 - contains pictures of product 2
> > etc.
> >
> > First, I'd like to have this just to keep stuff organized.
> >
> > Second, I'm displaying images with the Mini recipe - thanks Petko!!
> > great stuff!! - and would greatly appreciate if there was a way to tell
> > Mini to display all pictures of product 1 in one gallery, like
> >
> > Mini:product1/*.jpg
> >
> >
> > Is any of these two achievable?


You can have per-page subfolders for attachments, including for the Mini 
recipe. See for more information :
  http://www.pmwiki.org/wiki/PmWiki/UploadVariables#UploadPrefixFmt

So, in config.php you can add 
  $UploadPrefixFmt = '/$Group/$Name';

And then, your uploads structure will have subfilders for each page like
  /uploads/Main/Personal2  - uploads/attachments of page [[Main.Personal2]]
  /uploads/Private/Prototype4  - uploads of the page [[Private.Prototype4]]

Then, you can just use Mini:Page1/*.jpg to display all jpegs attached to Page1 
in the same group, and Mini:OtherGroup.Page2/* to show all pictures of a page 
Page2 in a different group OtherGroup.

Petko



More information about the pmwiki-users mailing list