[pmwiki-users] Re: conditional for existence of a file?

chr at home.se chr at home.se
Thu Jul 7 16:54:44 CDT 2005


On Thu, 7 Jul 2005, Neil Herber wrote:

> At 2005-07-07  11:54 AM -0500, Patrick R. Michaud is rumored to have said:
> >On Tue, Jul 05, 2005 at 06:19:10PM +0300, Leigh Hausman wrote:
> > > Er, something like, "There are no attachments associated with this
> > > page," maybe?
> >
> >I'm trying to decide if this should be part of the (:attachlist:)
> >markup or if it should be a conditional that can be used in
> >an   (:if attachments:) ... (:ifend:) sequence.
> >
> >Any thoughts?
> 
> I would find it very useful to have an   (:if attachments:) ... (:ifend:) 
> sequence because then I can control any of the lines I have surrounding the 
> attachment list. That text typically describes the ensuing list and has an 
> invitation to upload more files.

Sounds useful to me as well. Would it make sense to have an operator to 
(:if:) that simply returns the number of attachments? I'm assuming this 
would allow you to do:

	(:if attachments > 0:) ... (:ifend:)

Ahem... maybe it'd be better doing it like this:

	(:if (:attachments-count:) > 0:) .. (:ifend:)

or back to the original idea:

	(:if attachments-exist:) ... (:ifend:)

Regardless, I'd prefer having this in the conditional markup.

/Christian

-- 
Christian Ridderström, +46-8-768 39 44               http://www.md.kth.se/~chr





More information about the pmwiki-users mailing list