version=pmwiki-2.2.36 ordered=1 urlencoded=1 author=Petko charset=UTF-8 csum=Group PageActions ctime=1160022336 name=PmWiki.SitePageActions rev=16 targets=Site.PageActions,PmWiki.AvailableActions,Cookbook.Cookbook,PmWiki.BasicEditing,PmWiki.Skins,PmWiki.WikiStyles,PmWiki.AccessKeys,Site.Preferences,PmWiki.Internationalizations,PmWiki.Links,PmWiki.PageVariables,PmWiki.SitePageActions,PmWiki.ConditionalMarkup,PmWiki.DocumentationIndex,PmWiki.MailingLists text=(:Summary: how site page actions work:)%0a%25audience%25 authors (basic)%0a%0aThe [[Site.PageActions]] page is used as the source of the [[http://www.pmwiki.org/wiki/PmWiki/AvailableActions#defaultactions|default wiki commands]] shown in the default PmWiki skin at the top right of the page. It displays as follows:%0a[[%3c%3c]]%0a(:div id="wikicmds" class="float":)%0a(:include Site.PageActions:)%0a(:divend:)%0a[[%3c%3c]]%0aNote that there are many other [[available actions]] from the [[Cookbook/]], and PmWiki diagnostics and scripts.%0a%0aThis page gives a brief explanation of how [[Site.PageActions]] are displayed and formatted, and pointers to where more information can be found.%0a%0aBelow is what is shipped as [[Site.PageActions]] with PmWiki version 2.2:%0a->[@%0a* %25item rel=nofollow class=browse accesskey='$[ak_view]'%25 [[{*$FullName} | $[View] ]]%0a* %25item rel=nofollow class=edit accesskey='$[ak_edit]'%25 [[{*$FullName}?action=edit | $[Edit] ]]%0a* %25item rel=nofollow class=diff accesskey='$[ak_history]'%25 [[{*$FullName}?action=diff | $[History] ]]%0a(:if auth upload:)%0a* %25item rel=nofollow class=upload accesskey='$[ak_attach]'%25 [[{*$FullName}?action=upload | $[Attach] ]]%0a(:ifend:)%0a* %25item rel=nofollow class=print accesskey='$[ak_print]'%25 [[{*$FullName}?action=print | $[Print] ]]%0a(:if group Site,SiteAdmin,Cookbook,Profiles,PmWiki*:) (:comment delete if and ifend to enable backlinks:)%0a* %25item rel=nofollow class=backlinks accesskey='$[ak_backlinks]'%25 [[{*$Name}?action=search&q=link={*$FullName} | $[Backlinks] ]]%0a(:ifend:)%0a(:if enabled AuthPw:)%0a* %25item rel=nofollow class=logout accesskey="$[ak_logout]"%25'' [-[[{*$FullName}?action=logout | $[Logout] ]]-]''%0a(:ifend:)%0a@]%0a%0aTo start with, we'll look at just the first line, and take it apart. This will also give us a good handle on how most of the other lines work.%0a%0a!! List%0aEach line is an item in an unordered [[http://www.pmwiki.org/wiki/PmWiki/MarkupMasterIndex#Lists|list]], marked up by an unindented '@@*@@'. %0aYou can find out more about lists on the [[Basic Editing]] page.%0a%0aPmWiki will normally display an unordered list as a set of bulleted items, but they can appear differently depending on the context and styles they are displayed in. This difference in display is generally controlled by CSS defined in the [[Skins|Skin]]: for the PageActions links, the list items are displayed inline.%0a%0a!! Style%0aFollowing the '[@*@]', on the line we have [@%25item ... %25@] which is a [[WikiStyles|WikiStyle]]. It is used to control the properties of a given output element, like its size or color. By default they apply to the text between them and the end of the line or a closing [@%25%25@], whichever is sooner. So, for example, one can enter [@"this %25blue%25text%25%25 is blue"@] and it will appear as "this %25blue%25text%25%25 is blue".%0a%0aIn this case the WikiStyle starts with the word [@item@], and that says to apply the given style to the entire list item as opposed to just the text that follows. In particular, it causes PmWiki to generate HTML of%0a%0a->[@%3cli class='edit'>...%3c/li>@]%0a%0ainstead of%0a%0a->[@%3cli>%3cspan class='edit'>...%3c/span>%3c/li>@]%0a%0aSetting the class attribute of the list item allows CSS properties to be applied to the item that corresponds to the current action. For example, to have the current action display with a background color of blue, a wiki administrator can do:%0a%0a->@@$HTMLStylesFmt[]@@[@ = ' .{$Action} { background-color: blue; }';@]%0a%0aThen if the current action is 'edit' (as in "?action=edit"), the list item corresponding to the edit action will be drawn with a blue background.%0a%0aThe other property inside the [@%25item ... %25@] WikiStyle is the accesskey='$[ak_view]' statement. [[AccessKeys]] are keyboard shortcuts for tasks that would otherwise require a mouse. They can be attached to links or to form elements and the WikiStyle will use whichever it finds first on the line. In this case they will attach to the link [@[[{*$FullName} | $[View] ]]@].%0a%0a!! Accesskey%0aAn accesskey can be defined in a number of locations, but essentially it is a phrase translation following the model used for internationalizations. PmWiki's accesskey defaults are defined in @@scripts/prefs.php@@, but can be overridden in lots of different places, including skins, language translation pages (XLPage), and even per-browser preferences (see [[Site.Preferences]]).%0a%0aThe [@$[...]@] markup defines phrase translations, used for internationalizations (and access keys, as noted above). In the first line of [[Site.PageActions]] it is used in both [@$[ak_view]@] and [@$[View]@]. Essentially [@$[View]@] tells PmWiki to substitute the current translation of "View". If no translation is defined for "View", then PmWiki just uses the phrase inside the brackets.%0a%0aYou can most easily see this working in the other languages sections of PmWiki. For example, at [[(http://pmwiki.org/wiki/)PmWikiDe/PmWikiDe]] you'll notice that the default "View", "Edit", "History", and "Print" actions are displayed as "Artikel", "Bearbeiten", "Historie", and "Druckansicht".%0aThis is because the PmWikiDe group is loading in a set of translations from [[(http://pmwiki.org/wiki/)PmWikiDe.XLPage]] %0a%0aThat page defines things like%0a%0a->[@'View' => 'Artikel'%0a'Edit' => 'Bearbeiten'%0a'History' => 'Historie'%0a'Print' => 'Druckansicht'@]%0a%0awhich says that things like [@$[View]@] and [@$[Edit]@] should be replaced by "Artikel" and "Bearbeiten".%0a%0aThis makes it very easy for PmWiki to support multiple languages, since a recipe author can simply put any translatable prompts or phrases inside of [@$[...]@], and leave it to others to actually build the translation tables (either locally or on [[(http://)pmwiki.org]] for others to use). More information about [@$[...]@] is available at [[PmWiki/Internationalizations]].%0a%0a!! Link%0aAll that leaves on the first line to be explained is the [[PmWiki.Links|link]] itself: [@[[{*$FullName} | $[View] ]]@]. Links are not complex, but this one is using both the internationalization feature and a [[PageVariables|Page Variable]]. The [@$[View]@] has already been explained and it shows up in the link text section of link markup, so that, if viewed in English, the link will appear as [[[[{*$FullName} |$[View]]].%0a%0aThe link target section contains the [@{*$FullName}@] variable. This variable expands to the full name of the page on which it is being displayed, including the group and page names. For simple browsing, this is good enough, because viewing a page is the default action to perform on a page. Later lines use link targets like [@{*$FullName}?action=edit@] which says to go to the currently displayed page and start editing it.%0a%0a!! If%0aThis explains what all of the '[@*@]' lines are about. That only leaves the [@(:if auth upload:)@] and [@(:ifend:)@] lines, and they go together. The first starts some [[Conditional Markup]] and the second ends it. The [@(:if test :)@] markup only lets the following text be displayed if the test succeeds. The text that conditionally displayed ends at the next [@(:if...:)@] statement so an empty [@(:ifend:)@] is a convenient way to end the conditional block. The particular test being used here is [@auth upload@] which is only true if the current user is authorized to upload files to the wiki. Thus, the conditional block says to only display a link to perform an upload if the user is actually allowed to upload.%0a%0aDepending on the security and permissions model on a given site, its not unusual to see many more conditional markups that test if, for example, a user has editing rights to the current page. More information on all the different conditions can be found at the [[Conditional Markup]] page, and a general index of all the PmWiki documentation can be found at [[Documentation Index]].%0a%0aHopefully this bit of documentation has answered your questions about the [[Site.PageActions]] page. %0aIf not, you may wish to consult the helpful people on one of the [[MailingLists|PmWiki Mailing Lists]].%0a%0a!! Group PageActions%0aNote that any Group can have a PageActions page, not just '''Site'''. If a page named Group.PageActions exists, it will be used, otherwise, Site.PageActions, much like for the SideBar pages.%0a time=1335886785