<div class="gmail_quote">On Wed, Sep 1, 2010 at 8:55 PM, Bruce &amp; Ann Reidenbach <span dir="ltr">&lt;<a href="mailto:bereiden@gmail.com">bereiden@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
OK, so I have attempted to create a (:pageaction :) markup element, but I can&#39;t make it work.  I&#39;m enough of a noob to not understand what the problem is.  I know that PageAction is being called because I stuck some debug strings in there and they were being displayed on the page.  It just appears that setting the action to text is not working properly.<br>
</blockquote><div> </div><div>By the time your Markup() rule is called it is too late to change $action and make it have any effect. </div></div><br><div>PmWiki (in the big picture) does a bunch of configuration tasks and then it checks the value of $action and calls an action handler function based on the value of $action.  It is that action handler which then does everything else, including processing all the rules, including the one you have put in place.</div>
<div><br></div><div>Changing $action after the action handler is called is like shutting the barn door after the horse is gone...</div><div><br></div><div>The way I would solve it would be to redirect to the same page but with a different action=X parameter in the URL.  Make sure you check your $action first to avoid an infinite redirect and also to still allow yourself to edit the page, use diagnostics, etc.  If you want to get fancy you might want to look into (:pageaction browse=mynewaction print=myprint edit=myedit:) type of syntax which would allow mapping of various actions to other actions (take a look at the ParseArgs() function if you decide to try to implement this more generalized functionality).  </div>
<div><br></div><div>I&#39;m not personally seeing the utility of the rule, but the beauty of pmwiki is its flexibility in allowing everyone to use it in their own way...</div><div><br></div><div>-Peter</div>