|
|
authors, admins (intermediate)
PmWiki comes with two directives for generating lists of pages -- The Basic syntax
ParametersAny argument supplied within lists all "normal" pages listed in the DocumentationIndex trail that contain the word "apple" but not "pie". group= and name=The " # All pages in the Pmwiki group: (:pagelist group=PmWiki :) # All pages except those in the PmWiki or Site groups: (:pagelist group=-PmWiki,-Site :) # All RecentChanges pages (:pagelist name=RecentChanges :) # All pages except RecentChanges (:pagelist name=-RecentChanges :) WildcardsName and group parameters can contain wildcard characters that display only pages matching a given pattern:
Examples: # All pages in any group beginning with "PmWiki" (:pagelist group=PmWiki* :) # All pages in any group beginning with "PmWiki", except for Chinese (:pagelist group=PmWiki*,-PmWikiZh :) # All pages in the PmCal group with names starting with "2005": (:pagelist name=PmCal.2005* :) trail=The " # Display pages in the documentation by modification time (:pagelist trail=PmWiki.DocumentationIndex order=-time:) # Display five most recently changed pages (:pagelist trail=RecentChanges count=5:) list=The "
fmt=The "
These formats are defined in pagelist templates, which can be customized, as shown below. link=The " # all pages with a link to PmWiki.DocumentationIndex (:pagelist link=PmWiki.DocumentationIndex:) # all pages with links to the current page (:pagelist link={$FullName}:) # all pages in the "Skins" category (:pagelist link=Category.Skins:) count=The " # A simple bullet list of ten most recently modified pages (:pagelist trail=Site.AllRecentChanges count=10 fmt=#simple:) order=The "
Note: fmt=trail results in an unordered pagelist, i.e. the trail order is preserved in the pagelist. So PmWiki's alphabetical default order does not apply in this case.
Note: ctime was added to pages only from pmwiki 2.1.beta15 onwards, pages created by earlier versions don't carry a ctime attribute and can't be sorted that way.
ExamplesInclude the contents of a random page from the Banners group: Display a simple list of the last ten recently changed pages: Display the "top twenty" biggest cookbook pages: The Searchbox DirectiveThe
Customizing Pagelist TemplatesPmWiki's default templates are in Site.PageListTemplates, which is replaced during upgrades. These default templates can be supplemented with custom templates stored in other locations. As of version 2.1.10, PmWiki's default configuration looks for templates in Site.PageListTemplates, Site.LocalTemplates?, and the current page. Administrators can change those locations by using the
A pagelist template contains standard pmwiki markup. When creating pagelist output, pmwiki iterates over each page returned from the pagelist and will include the pagelist template markup once for every page in the list. During the page list iteration pmwiki sets 3 special page references: =,< and >. These special page references are updated on each pagelist iteration and can be used with the PageVariable syntax, such as {=$variable}, to define a pagelist template which will format the pagelist output. The meaning of the special references are: = current page so {=$Title} displays the title of the current page in the iteration < previous page so {<$Group} displays the group of the previous page in the iteration > next page so {>$Name} displays the name of the next page in the iteration The > and < references are most useful to help structure pagelist output before and after the actual pagelist. Some common tests used to structure pagelist output are: (:if equal {<$Group}:) # Iteration is at the beginning of list (:if equal {>$Group}:) # Iteration is at the end of list (:if ! equal {=$Group} {<$Group}:) # Iteration is at the first item in a group (:if ! equal {=$Group} {>$Group}:) # Iteration is at the last item in a group Three additional PageVariables are available during pagelist iterations which are not normally available, they are: {$PageCount} The current page count of this iteration {$GroupCount} The current group count of this iteration {$GroupPageCount} The current page count within the current group of this iteration It is advisable to not modify the Site.PageListTemplates file directly so that you will still benefit from upgrades. Instead, modify the Site.LocalTemplates page (which is not part of the PmWiki distribution). Cookbook:PagelistTemplateSamples has many examples of custom pagelist formats. In addition, the Cookbook:Cookbook has other recipes for special See Also
<< Categories | Documentation Index | Deleting pages >> How can I configure my site to always exclude wiki-related pages from searches? Try the following in your local/config.php file. See also Cookbook:SearchPatterns. ## Exclude Certain pages / groups from search results. $SearchPatterns['default'][] = '!\\.(All)?Recent(Changes|Uploads|Comments)$!'; $SearchPatterns['default'][] = '!\\.Group(Print)?(Header|Footer|Attributes)$!'; $SearchPatterns['default'][] = '!\\.(Left|Right|Side)(Bar|Menu|Note)$!'; $SearchPatterns['default'][] = '!^Site\\.!'; $SearchPatterns['default'][] = '!^PmWiki\\.!'; If you add |