Summary: Talk page for DynamicPageActions.
Maintainer: hartwork
Users: (View? / Edit)

This space is for User-contributed commentary and notes. Please include your name and a date along with your comment.


I was only able to get this to work by inserting an asterix before each $FullName. This is necessary with PmWiki version 2.2.0-beta1 and beyond. i.e..

* [[{*$FullName}?action=search | $[Search] ]]

-- James

Yes, thanks James. I found that without the asterisk, $Fullname would resolve to "site.pageActions" instead of the current page when viewing any but site and main groups. -- Dave

This does not work without UserAuth? Is it possible to have the Loggin when you're using passwords? Thanks a log- Chris

I'm not fully sure what you mean. UserAuth is needed for the "loggedin" conditional. --hartwork

I found a solution for myself. I'm not sure if it's right to add it here. Feel free to move it! If you want a Login when your using Passwords (View - Edit - History - Upload is hidden without a valid pass), your Site.PageActions should have something like this:

(:if !auth edit:)
* %item class=edit accesskey=$[ak_edit]%[[{$FullName}?action=edit | Login ]]
(:if auth edit:)
* %item class=browse accesskey=$[ak_view]%[[{$FullName} | $[View] ]]
(:if auth edit:)
* %item class=edit accesskey=$[ak_edit]%[[{$FullName}?action=edit | $[Edit] ]]
* %item class=diff accesskey=$[ak_history]%[[{$FullName}?action=diff | $[History] ]]
(:if auth upload:)
* %item class=upload accesskey=$[ak_attach]%[[{$FullName}?action=upload | $[Attach] ]]
* %item class=print accesskey=$[ak_print]%[[{$FullName}?action=print | $[Print] ]] }

The Login guides you to a password prompt and then to the edit mode. The View-Edit-History-Upload Buttons appear.

If you're using sectionEdit you may want, that the Edit section buttons do appear also after the Login. You have to modify the include_once for this file in your local config to this Code:

if (CondAuth ($pagename, 'edit')) {include_once('cookbook/sectionedit.php');}

Hope someone finds this helpful - Chris.

I indeed find this very useful. Thanks Chris! I wonder why this is not default in PmWiki? - Bastian, 2006-08-24

Now if you want login/logout based strictly on whether a password has been used in the session, you can use

(:if !enabled AuthPw:)
* [[{$FullName}?action=login | Login ]]
(:if enabled AuthPw:)
* [[Main/HomePage?action=logout | Logout ]]

A lot like Cookbook/AuthUserCMSLike, but with a different page. So, perhaps the two recipes should be merged?

This is my code for UserAuth 0.70:

* item class=browse accesskey='$[ak_view]' [[{$FullName} | $[View] ]]
(:if loggedin:)
* item rel=nofollow class=edit accesskey='$[ak_edit]' [[{$FullName}?action=edit | $[Edit] ]]
* item rel=nofollow class=diff accesskey='$[ak_history]' [[{$FullName}?action=diff | $[History] ]]
(:if auth upload:)(:if loggedin:)
* item rel=nofollow class=upload accesskey='$[ak_attach]'%25[[{$FullName}?action=upload | $[Attach] ]]
* item rel=nofollow class=print accesskey='$[ak_print]'%25[[{$FullName}?action=print | $[Print] ]]

Maybe be helpful.

Marcus Denning, HouseOfDenning.com, 20151207-23:20

This Login/Logout Conditional Logic Script is one I have added to my own Site.PageActions which you can edit appropriately to the desired condition.
Login prompt is one color.
Logout is one of two colors based on condition.
Logout Admin is RED.
Logout non-Admin is Green.
I have found this very useful in determining what login I just entered and whether or not it was actually the Admin the wiki recognized.

(:if ! enabled AuthPw:)
* %item rel=nofollow class=login  accesskey='$[ak_login]'%  '''''%color=#8a00ac%[[{*$FullName}?action=login  | $[Login]      ]]%%'''''
(:if enabled AuthPw:)
(:if2 auth admin:)
* %item rel=nofollow class=logout accesskey="$[ak_logout]"% '''''%color=#ff0000%[[{*$FullName}?action=logout | $[Logout]     ]]%%'''''
* %item rel=nofollow class=logout accesskey="$[ak_logout]"% '''''%color=#00ff00%[[{*$FullName}?action=logout | $[Logout]     ]]%%'''''

Next comment here and shove this down please. Thanks.

Talk page for the DynamicPageActions recipe (users?).