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

Patrick R. Michaud pmichaud at pobox.com
Thu Jul 7 20:05:03 CDT 2005


On Thu, Jul 07, 2005 at 11:54:44PM +0200, chr at home.se wrote:
> 
> 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:)

This doesn't follow the standard (:if:) syntax, so probably not.
I was just going to leave it as a boolean "does this page have
any attachments").

> Ahem... maybe it'd be better doing it like this:
> 
> 	(:if (:attachments-count:) > 0:) .. (:ifend:)

Except I'd expect a simple markup substitution like this to look
more like {$AttachmentsCount} instead.

> or back to the original idea:
> 	(:if attachments-exist:) ... (:ifend:)

Yeah, I'm thinking this is the way we'll go.

Pm



More information about the pmwiki-users mailing list