Summary: Drop-down menu to page actions (Edit, History, Attach...) instead of links.
Prerequisites: PmWiki 2.2.58 or later
A drop-down menu to page actions (Edit, History, Attach...) instead of links..
When a user selects some action from the menu, the current page is open with this action, for example
On some wiki designs a drop-down menu may be more convenient than a list of links. For example, in minimalist or mobile skins, a drop-down menu takes less screen area.
Copy actionmenu.phpΔ to your /cookbook/ directory. Add to config.php such a line:
In the page Site.PageActions, or in a SideBar, GroupHeader or GroupFooter, add the following markup:
(:actions browse="$[View]" edit="$[Edit]" upload="?$[Attach]":)
The markup should start at the beginning of a line. The actions are in the format
actionname="Menu label" where
actionname could be browse, edit, diff, upload, attr, backlinks, logout, or any other core action or added by recipes.
The recipe tries to work in a smart way:
- if the action "browse" is selected, the page will be opened without any action
- if the visitor is not logged in, the "logout" action will be hidden
- the action "backlinks" actually opens a search for
link=CurrentPage like here on pmwiki.org
- actions can be shown only if the visitor has permissions for these actions, add a question mark at the beginning of the text label:
It is possible to display some short text on the same line, before and after the drop-down select-box:
(:actions "Text before" browse="$[View]" edit="$[Edit]" "Text after":)
(:actions "" browse="$[View]" edit="$[Edit]" "Text after":)
(:actions "Select action:" browse="$[View]" edit="$[Edit]" diff="$[History]" upload="?$[Attach]" attr="?$[Attributes]" print="$[Print]" backlinks="$[Backlinks]" diag="Diagnostic" ruleset="Rule set" phpinfo="PHP info" logout="$[Logout]":)
Change log / Release notes
- 20150422 fix for international page names, update for PHP 5.5.
- 20111004 first public release, ready to be tested.
- Cookbook /
- JumpBox A pull down menu that can be used for navigation
- OptionMenu Get page listings as an option menu selector (Stable)
- Recipe written and maintained by Petko (5ko [snail] 5ko [period] fr).
- If this recipe helps you or saves you time, you can help support its continued development by ♥ .
See discussion at ActionMenu-Talk.
User notes? : If you use, used or reviewed this recipe, you can add your name. These statistics appear in the Cookbook listings and will help newcomers browsing through the wiki.