<div dir="ltr">Try turning on diagnostics and then loading with ?action=ruleset.<div><br></div><div>Confirm that the rule '{$Var}' occurs before the rule 'if'.</div><div><br></div><div>Confirm that the rule '{(' occurs before '{$Var}' -- oops! I just checked it on my own system and '{$Var}' occurs before '{('. This will mean that the variable-substitution will be attempted before you have created the variable name using your markup expression. Of course the difficulty is that often markup expressions use variables and so you wouldn't really want to swap the order.  You may want to implement my '{earlymx(' rule that I have in WikiSh.php.  The markup itself is about as ugly as I think could be invented, but it will solve your problem. Other, more elegant, solutions will hopefully be suggested by others.</div><div><br></div><div>-Peter</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Apr 2, 2015 at 11:51 AM, Criss Ittermann <span dir="ltr"><<a href="mailto:crisses@kinhost.org" target="_blank">crisses@kinhost.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><div>Thank you, it spits out:</div><div><br></div><div><span style="color:rgb(24,24,24);font-family:'Liberation sans',Verdana,Arial,Helvetica,sans-serif;line-height:15px">(:if exists Profile-Data.{Members/Hosts$:201504} :) [...] (:else:) [...] (:if:)</span></div><div><span style="color:rgb(24,24,24);font-family:'Liberation sans',Verdana,Arial,Helvetica,sans-serif;line-height:15px"><br></span></div><div><span style="color:rgb(24,24,24);font-family:'Liberation sans',Verdana,Arial,Helvetica,sans-serif;line-height:15px">So the PTV does not appear to have been processed yet -- the markup expression has, though.  And this goes for ALL the PTVs throughout the entire IF condition, including the ones I've redacted with [...]</span></div><div><span style="color:rgb(24,24,24);font-family:'Liberation sans',Verdana,Arial,Helvetica,sans-serif;line-height:15px"><br></span></div><div><span style="color:rgb(24,24,24);font-family:'Liberation sans',Verdana,Arial,Helvetica,sans-serif;line-height:15px">However this violates documentation:</span></div><div><span style="color:rgb(24,24,24);font-family:'Liberation sans',Verdana,Arial,Helvetica,sans-serif;line-height:15px"><br></span></div><div><h3 style="margin-top:1em;margin-bottom:0.6em;font-weight:normal;font-size:1.22em;font-family:Arial,Helvetica,sans-serif;line-height:19.50666618347168px">Use page text variables in <a href="http://www.pmwiki.org/wiki/PmWiki/ConditionalMarkup" target="_blank">conditional markup</a></h3><div style="margin-top:0px;margin-bottom:0px;font-family:Arial,Helvetica,sans-serif;font-size:15px;line-height:19.50666618347168px">Page text variables will be assigned/evaluated <strong>before</strong> any conditional markup is evaluated. This effectively means that you cannot declare a PTV within an if...else condition; and also that a PTV will have a value even if it is set within a <code style="font-size:0.9em;font-family:'Lucida Console','Andale Mono','Courier New',Courier,monospace;white-space:nowrap">(:if false:)....(:if:)</code> condition.</div></div><div><br></div><div>on page</div><div><a href="http://www.pmwiki.org/wiki/PmWiki/PageTextVariables" target="_blank">http://www.pmwiki.org/wiki/PmWiki/PageTextVariables</a></div><div><br></div><div>I upgraded to the latest version and it still doesn't work.  I turned off each recipe and commented out sections of code that even vaguely might affect conditional processing or PTV evaluation one at a time (it's a live site), and no change.  I did not comment out authentication, captcha or PmForm, since these would break the site in a very bad way and are released by PM & Petko.</div><div><br></div><div>Just for giggles, to take the complexity out of the if-conditional, I even tried:</div><div><br></div><div><div>TempVar:Profile-Data.{Members/Hosts$:{(ftime "%Y%m")}}</div><div><br></div><div>(:if exists {$:TempVar} :)</div></div><div><br></div><div>But of course, that failed too.  But the variable itself is set correctly.</div><div><br></div><div>This fails too, whether I use the full expression, or the new variable:</div><div><br></div><div>(:if equal "{$:TempVar}" "Profile-Data.HEdelman" :)  </div><div>revealing the if conditional before it processes:</div><div><span style="color:rgb(24,24,24);font-family:'Liberation sans',Verdana,Arial,Helvetica,sans-serif;line-height:15px">(:if equal "Profile-Data.{Members/Hosts$:201504}" "Profile-Data.HEdelman" :)</span></div><div><br></div><div><br></div><div><div>(:if false:)</div><div>TempVar:Profile-Data.{Members/Hosts$:{(ftime "%Y%m")}}</div><div>(:if:)</div></div><div><br></div><div>Still sets the variable.</div><div><div class="h5"><br><div><blockquote type="cite"><div>On Apr 1, 2015, at 8:25 PM, John Rankin <<a href="mailto:john.rankin@affinity.co.nz" target="_blank">john.rankin@affinity.co.nz</a>> wrote:</div><br><div>
  
    
  
  <div bgcolor="#FFFFFF" text="#000000">
    It may be possible to intercept the if code and find out what
    condition pmwiki is evaluating, which should give information about
    what is happening. Try this in local/config.php:<br>
    <br>
    $CondTextReplacement = "MyTempRepl(\$pagename, \$m[0], \$m[1])";<br>
    function MyTempRepl($pagename, $text, $code='') {<br>
      echo $text;<br>
      return CondText2($pagename, $text, $code);<br>
    }<br>
    <br>
    If I am reading stdmarkup.php correctly, this should echo the
    contents of the if code at the time the conditional is evaluated,
    which will show whether the var has been evaluated as intended.<br>
    <br>
    JR<br>
    <br>
    <div>On 2/04/15 12:07 AM, Criss Ittermann
      wrote:<br>
    </div>
    <blockquote type="cite">
      
      <div>I'm trying to figure out why this is returning false
        ("To be announced."):</div>
      <div><br>
      </div>
      <div>
        <div>(:if exists Profile-Data.{Members/Hosts$:{(ftime
          "%Y%m")}} :)</div>
        <div>...</div>
        <div>(:else:)</div>
        <div>To be announced.</div>
        <div>(:ifend:)</div>
        <div><br>
        </div>
        <div><br>
        </div>
        <div>When the following returns a fully functioning
          link to the correct page, which exists:</div>
        <div><br>
        </div>
        <div>[[Profile-Data.{Members/Hosts$:{(ftime "%Y%m")}}]]</div>
      </div>
      <div><br>
      </div>
      <div><br>
      </div>
      <div>What am I doing wrong?</div>
      <br>
      <div><div style="margin:0px"><font style="font:12.0px Comic Sans MS" face="Comic Sans
            MS" size="3">Crisses</font></div><div style="margin:0px"><br>
        </div>
      </div>
      <br>
      <fieldset></fieldset>
      <br>
      <pre>_______________________________________________
pmwiki-users mailing list
<a href="mailto:pmwiki-users@pmichaud.com" target="_blank">pmwiki-users@pmichaud.com</a>
<a href="http://www.pmichaud.com/mailman/listinfo/pmwiki-users" target="_blank">http://www.pmichaud.com/mailman/listinfo/pmwiki-users</a>
</pre>
    </blockquote>
    <br>
    <pre cols="72">-- 
John Rankin
Affinity Limited
T <a href="tel:%2B64%204%20495%203737" value="+6444953737" target="_blank">+64 4 495 3737</a>
M <a href="tel:%2B64%2021%20726%20546" value="+6421726546" target="_blank">+64 21 726 546</a></pre>
  </div>

_______________________________________________<br>pmwiki-users mailing list<br><a href="mailto:pmwiki-users@pmichaud.com" target="_blank">pmwiki-users@pmichaud.com</a><br><a href="http://www.pmichaud.com/mailman/listinfo/pmwiki-users" target="_blank">http://www.pmichaud.com/mailman/listinfo/pmwiki-users</a><br></div></blockquote></div><br></div></div></div><br>_______________________________________________<br>
pmwiki-users mailing list<br>
<a href="mailto:pmwiki-users@pmichaud.com">pmwiki-users@pmichaud.com</a><br>
<a href="http://www.pmichaud.com/mailman/listinfo/pmwiki-users" target="_blank">http://www.pmichaud.com/mailman/listinfo/pmwiki-users</a><br>
<br></blockquote></div><br></div>