This may be a solution. I tried it on a local install with Evo 1.0.2 and it seemed to work...
The scenario is that I have a page which contains a call to WebLogin. I want the title to be dynamic depending upon the web user’s login status. That is, in a Wayfinder menu I want it to say "Login" if the user is not logged in and "Logout" if the user is logged in. As importantly, if they are logged in and click on the menu item, I not only want the page brought up but I want them automatically logged out.
In my test, I created a document with the WebLogin call and noted it’s id number. In this case it was 139.
I created two template variables. The first TV was called "loginName" and is taken from the material installed when one selects "Install Sample Data" when doing the MODx installation. Specifically, it is a text TV with a default value of
@EVAL if ($modx->getLoginUserID()) return 'Logout'; else return 'Login';
The second TV I called "loginAction". It is also a text TV with a default value of
@EVAL if ($modx->getLoginUserID()) return '<a href="[~139~]&webloginmode=lo">Logout</a>'; else return '<a href="[~139~]">Login</a>';
Turning now to the document that I created above (the one with id=139), I put
in the field "Title" and I put
in the field "Menu title".
This would appear to generate the behavior I need. If anyone sees any problems with this, I’d appreciate hearing about it.
UPDATE : This worked with FURLs on and no suffix attached to the link generated. No doubt this will bust spectacularly if that’s not the case ...
EDIT : "?" should be "&" I think ...
Thanks for listening,
MattC