<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
<font face="Helvetica, Arial, sans-serif"><br>
Hi,<br>
<br>
I confirm that:<br>
</font>
<pre wrap=""><font face="Helvetica, Arial, sans-serif">(:if2 false:)
APACStatus:(:if equal "{$:ApprovalStatusAPAC}""Approved":)Attach:tick.png(:ifend:)
(:if2end:)</font></pre>
<font face="Helvetica, Arial, sans-serif">works as you described.<br>
<br>
Thank you!! - I very much appreciate the help/explanation.<br>
<br>
rgds<br>
<br>
Graham<br>
</font><br>
Eemeli Aro wrote:
<blockquote
cite="mid:c133a1660908110701l7bcd6df0mfb3828f75f559fb2@mail.gmail.com"
type="cite">
<pre wrap="">2009/8/11 Graham Archer <a class="moz-txt-link-rfc2396E" href="mailto:Graham.Archer@sun.com"><Graham.Archer@sun.com></a>:
</pre>
<blockquote type="cite">
<pre wrap="">Regarding PTV's and conditional markup.....
I read at PmWiki/PageTextVariables-Talk that it's possible to do:
LinkUrl: (:if name{$FullName}:)<a class="moz-txt-link-freetext" href="http://dilbert.com(:else:)">http://dilbert.com(:else:)</a>[[Cookbook:Quotes]](:ifend:)
{$:LinkUrl}
</pre>
</blockquote>
<pre wrap=""><!---->
I'm the one who added that to the page, so probably ought to take some
responsibility here...
Thinking about this a bit more, the answer's perhaps a bit trickier
than I first thought. What's happening with the above is that the
value of LinkUrl will be set to all of '(:if
name{$FullName}:)<a class="moz-txt-link-freetext" href="http://dilbert.com(:else:)">http://dilbert.com(:else:)</a>[[Cookbook:Quotes]](:ifend:)',
ie. the value of the conditional expression isn't evaluated until it's
used on a page, in which case it'll get evaluated for each time it's
used.
Provided that you've got $EnableRelativePageVars set to true this
should be fine, even when used from another page -- except for
conditionals such as (:if name:) and (:if group:), which will get
evaluated in the context of the including page irrelevant of
$EnableRelativePageVars.
</pre>
<blockquote type="cite">
<pre wrap="">or in my case I can do:
APACStatus:(:if equal "{$:ApprovalStatusAPAC}" "Approved"
:)Attach:tick.png(:ifend:)
{$:APACStatus}
However in doing this the PTV ( APACStatus) in the first line is shown to
the reader, I'd like that hidden
</pre>
</blockquote>
<pre wrap=""><!---->
Hmmm. Apologies for the slight mindfuck, but the following should work
(see example near the end of <a class="moz-txt-link-rfc2396E" href="http://www.pmwiki.org/wiki/Test/Ptv"><http://www.pmwiki.org/wiki/Test/Ptv></a> if
this gets mangled):
(:if2 false:)
APACStatus:(:if equal "{$:ApprovalStatusAPAC}"
"Approved":)Attach:tick.png(:ifend:)
(:if2end:)
or alternatively:
</pre>
<blockquote type="cite">
<blockquote type="cite">
<pre wrap="">comment<<
</pre>
</blockquote>
</blockquote>
<pre wrap=""><!---->APACStatus:(:if equal "{$:ApprovalStatusAPAC}"
"Approved":)Attach:tick.png(:ifend:)
</pre>
<blockquote type="cite">
<blockquote type="cite">
<pre wrap=""><<
</pre>
</blockquote>
</blockquote>
<pre wrap=""><!---->
</pre>
<blockquote type="cite">
<pre wrap="">Therefore I would like to do something like ....
(:APACStatus:(:if equal "{$:ApprovalStatusAPAC}" "Approved"
:)Attach:tick.png(:ifend:):)
{$:APACStatus}
But it seems either I'm using the wrong syntax, or perhaps this is not
possible, or at least not possible in the way I am trying!!
Would appreciate any advice on this.
</pre>
</blockquote>
<pre wrap=""><!---->
What you tried didn't work since you can't easily nest (:directives:)
-- they're always terminated by the first matching :) which will break
stuff if the outer directive gets evaluated first. Especially as page
text variables are read from the markup outside the normal order of
markup -> HTML transformations.
eemeli
</pre>
<blockquote type="cite">
<pre wrap="">Thank you
Graham
</pre>
</blockquote>
<pre wrap=""><!---->
_______________________________________________
pmwiki-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:pmwiki-users@pmichaud.com">pmwiki-users@pmichaud.com</a>
<a class="moz-txt-link-freetext" href="http://www.pmichaud.com/mailman/listinfo/pmwiki-users">http://www.pmichaud.com/mailman/listinfo/pmwiki-users</a>
</pre>
</blockquote>
</body>
</html>