version=pmwiki-2.2.0 ordered=1 urlencoded=1 agent=Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.5) Gecko/2008120122 Firefox/3.0.5 author=HansB charset=ISO-8859-1 csum=update ctime=1160022336 host=80.41.219.196 name=PmWiki.SitePageActions rev=7 targets=Site.PageActions,PmWiki.BasicEditing,PmWiki.Skins,PmWiki.WikiStyles,PmWiki.AccessKeys,Site.Preferences,PmWiki.Internationalizations,PmWiki.Links,PmWiki.PageVariables,PmWiki.SitePageActions,PmWiki.ConditionalMarkup,PmWiki.DocumentationIndex,PmWiki.MailingLists,PmWiki.PageActions text=%25audience%25 authors (basic)%0a%0aThe [[Site.PageActions]] uses a large number of PmWiki features in concert. %0aThis page gives a brief explanation of the features commonly used on [[Site.PageActions]], and pointers to where more information can be found.%0a%0aTo start with, lets look at a typical Site.PageActions page.\\%0aBelow is what is currently shipping with PmWiki version 2.2.0:%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:) (: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%0aThat can seem a bit daunting, but we'll take it piece by piece. To 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%0aThe first line, and in fact every line, begins with an unindented '@@*@@', which means its an item in an unordered list. %0aYou can find out more about lists on the [[Basic Editing]] page. %0aPmWiki will normally display an unordered list as a set of bulleted items, but they can appear differently depending on the context they are displayed in. This difference in display is generally controlled by CSS defined in the Skin.%0a%0aIf you take a look at the [[Site.PageActions]] page with the default PmWiki [[PmWiki.Skins|skin]], you'll see that the list appears twice, once as a normal bulleted list in the middle of the page, and once as a row of unbulleted actions at the top right corner of the page. This is controlled by the fact that they are being rendered inside an HTML [@%3cdiv>@] with an [@id@] of 'wikicmds' and the CSS for the default PmWiki skin asks that list items inside a wikicmds element be displayed that way.%0a%0aYou can see the difference for yourself since PmWiki has markup that lets you ask for something to be rendered inside a div with a given [@id@]:%0a(:markup class=horiz:)%0a* test1%0a* test2%0a* test3%0a%0a(:div id=wikicmds:)%0a* test1%0a* test2%0a* test3%0a(:divend:)%0a(:markupend:)%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----%0a%0a%25green%25Note that any Group can have a [[Page Actions]] page, not just '''Site''' - this page should be edited to reflect that.%0a time=1233331974