[pmwiki-users] pmwiki-users Digest, Vol 30, Issue 16
Peter & Melodye Bowers
pbowers at pobox.com
Thu Dec 6 14:43:30 CST 2007
> From: "TSgt Marshall Kelly" <marshall.kelly at txsg.org>
> Subject: [pmwiki-users] Debugging help?
>
> (:if equal $:dateOfEntryMM 01:)
> (:MMOf6MoAnniv: 07:)
> (:YYYYOf6MoAnniv: {(math '{$:dateOfEntryYYYY} + 0')}:)
> (:ifend:)
>...
>
> (:if equal $:dateOfEntryMM 12:)
> (:MMOf6MoAnniv: 06:)
> (:YYYYOf6MoAnniv: {(math '{$:dateOfEntryYYYY} + 1')}:)
> (:ifend:)
Quoting from http://www.pmwiki.org/wiki/PmWiki/PageTextVariables
===(snip)===
Note
ConditionalMarkup does not work with page text variables or include
other pages.
Page text variables don't honor (:if:). This is the same way that doing
(:include OtherPage#section:) doesn't look to see if [[#section]] is inside
of an (:if:)...(:ifend:) construct of some sort.
===(snip)===
I put some text in each of the (:if...:) ... (:ifend:) to visually SEE what
was happening and it looks like NONE of them were evaluating to true. When
I changed them by putting curly braces around the PTV like so:
(:if equal {$:dateOfEntryMM} "05":)
(quotes not necessary, but less ambiguous, at least to me)
Then I at least got my text to display in the appropriate spot. So I think
there was a syntactical problem, but the larger issue is that PTVs don't
play nicely with conditionals...
Just for a lark I changed the lines
(:MMOf6MoAnniv: XX:)
To
:MMOf6MoAnniv: XX
And then instead of EVERY definition being evaluated it appears that NONE of
them get evaluated and you end up with a blank variable at the end. So
apparently the hidden directive and the definition list work differently,
but neither of them play nicely with the conditionals (as documented).
-Peter
More information about the pmwiki-users
mailing list