(:if attachments:)to specify file names
Added for 2.2.77 in the format
(:if attachments FILEPATTERNS PAGENAME:). --Petko June 13, 2015, at 10:30 AM
- Extend the
(:if attachments:)conditional markup expression to allow the optional specification of one or more file descriptors, eg
(:if attachments ext='jpg,jpeg':)
or perhaps more generally
(:if attachments descriptor='*.jpg,*.jpeg':)
This would also apply to the pagelist if parameter.
See also PITS.01093 Enhance conditional markup to 'if attachments PAGENAME'.
The use I have for it is as follows:
A condition for a list of files is an excellent idea and would not be hard to add, I'll think about it. For the Thumblist example you can use
quiet=3 to suppress any warnings and to display nothing if the page has no attached pictures. --Petko March 27, 2009, at 03:38 AM
Hi. I was considering adding this to the core, but I have a doubt. If the markup was like this:
(:if attachments Group.Page/*.jpg:)this is fine and clear enough
(:if attachments Group.Page/*:)this is fine and clear enough
(:if attachments *.jpg:)is this fine?
(:if attachments image.jpg:)is this fine?
(:if attachments Group.Page:)is this fine?
The last two commands are ambiguous -- is "X.Y" it a wiki page, or a file? Comments are welcome. --Petko July 02, 2009, at 09:22 AM
For the ambiguous cases the thought that springs to mind is syntax from other directives
(:if attachments image.jpg:)is fine
(:if attachments name=Group.Page:)
We also have cases that one might expect to work such as
(:if attachments Group/image.jpg:)which would refer to the home page of the group
Some other cases might be
(:if attachments image.jp?g:)no problems with this as "?" is not allowed in a page name
(:if attachments image.jpg image.jpeg:)multiple possible attachments, true if any are found
(:if attachments name Group.Page,Group2.Page2:)multiple pages, conditional markup syntax
(:if attachments name=Group.Page,Group2.Page2:)multiple pages, directive syntax
(:if attachments group Group,Group2 image.jpg image.jpeg:)multiple groups, multiple images on any pages in groups (perhaps not useful, but syntactically consistent)
(Actually looking at the ConditionalMarkup syntax makes me wonder if we should align the directive and conditional markup synatx, hmmmm, email list discussion perhaps)
Simon July 02, 2009, at 03:56 PM
I'm afraid we'll leave all these complex conditional expressions for a cookbook recipe, until an actual need for many wikis is obvious. The markup I'm considering is this:
(:if attachments image.jpg Group.Page:) where
Group.Page or just
Group. is optional, if omitted means the current page,
image.jpg is optional, if omitted means "
*" (any attachment), and could be:
With this variant, the current
(:if attachments:) will continue to work as it does today. --Petko July 03, 2009, at 06:15 AM