version=pmwiki-2.1.11 ordered=1 urlencoded=1
agent=Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.2) Gecko/20060308 Firefox/1.5.0.2
author=Pico
csum=
ctime=1138643894
host=12.33.45.37
name=PmWiki.PageLists
rev=66
targets=PmWiki.WikiTrails,PmWiki.Categories,Site.PageListTemplates,Site.LocalTemplates,PmWiki.Directives,PmWiki.PagelistVariables,PmWiki.DocumentationIndex
text=%25audience%25 authors, admins (intermediate)%0aPmWiki comes with two directives for generating lists of pages -- [@(:pagelist:)@] and @@[=(:=]searchresults:)@@.  Both directives are basically the same and each accepts the parameters documented below.  The primary difference between the two is that searchresults generates the "Results of search for ..." and "### pages found out of ### searched" messages around the results.%0a%0aThe [@(:searchbox:)@] directive generates a search form (input text box) to submit search queries.  The markup generally accepts the same parameters as [@(:pagelist:)@], which makes it possible to restrict, order and format searchresults in the same ways that are described below for a [@(:pagelist:)@].  For more information about the [@(:searchbox:)@] directive, and the ways in which it differs from a [@(:pagelist:)@], skip to the section [[#searchbox|below]].%0a%0a!! Basic syntax%0a%0a* [@(:pagelist:)@] without any arguments shows a bulleted list of all pages, as links, ordered alphabetically and in groups.%0a* [@(:pagelist group=abc fmt=def list=ghi order=jkl argument1 argument2 etc:)@] shows a pagelist according to the  parameters supplied. Parameters are optional.%0a%0a!!Parameters%0aAny argument supplied within [@(:pagelist:)@] that isn't in the form @@'key=value'@@ is treated as text that either must (or must not) exist in the page text.  The minus sign (-) or exclamation mark (!) can be used to indicate the logical ''not''. Thus%0a%0a    [@(:pagelist trail=PmWiki.DocumentationIndex list=normal apple -pie:)@]%0a%0alists all "normal" pages listed in the DocumentationIndex trail that contain the word "apple" but not "pie".%0a%0a!!!group= and name= %0a%0aThe "[@group=@]" and "[@name=@]" parameters limit results to pages in a specific group or with a specific name:%0a%0a    [@# All pages in the Pmwiki group:%0a    (:pagelist group=PmWiki :)%0a    # All pages except those in the PmWiki or Site groups:%0a    (:pagelist group=-PmWiki,-Site :)%0a    # All RecentChanges pages%0a    (:pagelist name=RecentChanges :)%0a    # All pages except RecentChanges%0a    (:pagelist name=-RecentChanges :)@]%0a%0a!!!Wildcards%0aName and group parameters can contain ''wildcard'' characters that display only pages matching a given pattern:%0a* An asterisk (*) represents zero or more characters%0a* A question mark (?) represents exactly one character%0a%0aExamples:%0a%0a    [@# All pages in any group beginning with "PmWiki"%0a    (:pagelist group=PmWiki* :)%0a    # All pages in any group beginning with "PmWiki", except for Chinese%0a    (:pagelist group=PmWiki*,-PmWikiZh :)%0a    # All pages in the PmCal group with names starting with "2005":%0a    (:pagelist name=PmCal.2005* :)@]%0a%0a!!!trail= %0aThe "[@trail=@]" option obtains the list of pages to be displayed from a [[WikiTrail(s)]]:%0a%0a    [@# Display pages in the documentation by modification time%0a    (:pagelist trail=PmWiki.DocumentationIndex order=-time:)%0a    # Display five most recently changed pages%0a    (:pagelist trail=RecentChanges count=5:)@]%0a%0a!!!list= %0a%0aThe "[@list=@]" option allows a search to include or exclude pages according to predefined patterns set by the administrator.  %0a* "[@list=normal@]" is predefined, and which excludes things like AllRecentChanges, RecentChanges, GroupHeader, GroupFooter, GroupAttributes, and the like from being displayed in the list results.  %0a* "[@list=all@]" over-rides a "default" list that may be set by the wiki's administrator to exclude groups such as PmWiki or Site from regular search results.%0a* Wiki administrators can define custom lists via the $SearchPatterns array (see [[Cookbook:SearchResults]]).%0a%0a!!!fmt= %0a%0aThe "[@fmt=@]" option determines how the resulting list should be displayed.  PmWiki predefines several formats:%0a* @@fmt=#bygroup@@ - Display pages within groups (default format)%0a* @@fmt=#simple@@ - Display a simple ordered list of pages in the form Group.Name%0a* @@fmt=#title@@ - Display a list of pages by page title.  Use "[@order=title@]" to have them sorted by title (default is to order by page name).%0a* @@fmt=#group@@ - Display a list of wikigroups (without listing the pages in the groups)%0a* @@fmt=#include@@ - Display the contents of each page in the list (note, this could take a very long time for long lists!)%0a%0aThese formats are defined in pagelist templates, which can be customized, as shown [[#templates|below]].%0a%0a[[#pagelistlink]]%0a!!!link= %0a%0aThe "[@link=@]" option implements "backlinks" -- i.e., it returns a list of pages with a link to the target.  It's especially useful for [[categor(ies)]]y pages and finding related pages.%0a%0a    [@# all pages with a link to PmWiki.DocumentationIndex%0a    (:pagelist link=PmWiki.DocumentationIndex:)%0a    # all pages with links to the current page%0a    (:pagelist link={$FullName}:)%0a    # all pages in the "Skins" category%0a    (:pagelist link=Category.Skins:)@]%0a%0a!!!count= %0a%0aThe "[@count=@]" option limits the pagelist to a specific number of pages.%0a%0a    [@# A simple bullet list of ten most recently modified pages%0a    (:pagelist trail=Site.AllRecentChanges count=10 fmt=#simple:)@]%0a%0a!!!order=%0a%0aThe "[@order=@]" option allows the pages in the list to be sorted according to different criteria.  Use a minus sign to indicate a reverse sort.  Multiple sorting criteria can be specified using a comma:%0a* [@order=name@] - alphabetically by name (default order)%0a* [@order=title@] - sorted alphabetically by title rather than names%0a* [@order=time@] - most recently changed pages '''last'''%0a* [@order=ctime@] - time of page creation (see note)%0a* [@order=size@] - sort by page size (not file size), smallest pages first.%0a* [@order=group,title@] - sort by title within groups%0a* [@order=random@] - shuffle the pages into random sequence%0a%0a->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.%0a%0a->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.%0a%0a!! Examples%0a%0aInclude the contents of a random page from the Banners group:%0a%0a    [@(:pagelist group=Banners order=random count=1 fmt=#include list=normal:)@]%0a%0aDisplay a simple list of the last ten recently changed pages:%0a%0a    [@(:pagelist trail=Site.AllRecentChanges count=10 fmt=#simple:)@]%0a%0aDisplay the "top twenty" biggest cookbook pages:%0a%0a    [@(:pagelist group=Cookbook order=-size count=20 :)@]%0a%0a%0a[[#searchbox]]%0a!!The Searchbox Directive%0a%0aThe [@(:searchbox:)@] directive generally accepts the same parameters as [@(:pagelist:)@], with the following differences:%0a*Parameters can be added to the input text of a searchbox (or to the markup, or both)%0a*The target page for displaying searchbox results can be set with the parameter target=''GroupName.PageName''.  The default is the current page. %0a*An initial search string can be specified in the searchbox markup, but it must be in the form @@value='search string'@@.  That search string is displayed in the input text and can be modified by when the search is run.%0a**Tip:  If more than one searchbox appears on a page, adding a blank initial value like this @@value=''@@, to the markup for each searchbox will prevent a search string for one box from populating all of the other boxes.%0a%0a[[#templates]]%0a!!Customizing Pagelist Templates%0a%0aPmWiki'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 $FPLTemplatePageFmt variable.  Custom templates are used in the same way as default templates: by referencing the desired format with the [@fmt=@] option.  There are several ways to indicate which template to use:%0a* [@fmt=#custom@] uses the #custom section from [[Site.PageListTemplates]], [[Site.LocalTemplates]], or current page (sections are denoted by [@[[#custom]]@] anchors.%0a* [@fmt=MyTemplatePage#custom@] uses a custom format from page MyTemplatePage from its #custom section.%0a* [@fmt=custom@] uses custom format which is defined in a cookbook script as ''custom''.%0a%0aA 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: =,%3c 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:%0a%0a   =   current page    so ''{=$Title}'' displays the title of the current page in the iteration%0a   %3c   previous page   so ''{%3c$Group}'' displays the group of the previous page in the iteration%0a   >   next page       so ''{>$Name}''  displays the name of the next page in the iteration%0a%0aThe > and %3c references are most useful to help structure pagelist output before and after the actual pagelist.  Some common tests used to structure pagelist output are:%0a%0a    [@(:if equal {%3c$Group}:)              # Iteration is at the beginning of list%0a    (:if equal {>$Group}:)              # Iteration is at the end of list%0a    (:if ! equal {=$Group} {%3c$Group}:)  # Iteration is at the first item in a group%0a    (:if ! equal {=$Group} {>$Group}:)  # Iteration is at the last item in a group @]%0a%0aThree additional PageVariables are available during pagelist iterations which are not normally available, they are: %0a%0a    [@{$PageCount}       The current page count of this iteration%0a    {$GroupCount}      The current group count of this iteration%0a    {$GroupPageCount}  The current page count within the current group of this iteration @]%0a%0aIt 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.%0a%0aIn addition, the [[Cookbook:Cookbook]] has other recipes for special [@fmt=@] options, including [[Cookbook:DictIndex | [@fmt=dictindex@] ]] (alphabetical index) and [[Cookbook:SimpleForum | [@fmt=forum@] ]] (forum postings).%0a%0a!! See Also%0a%0a* [[Directives#attachlist]] - display a list of attachments%0a* [[Site.PageListTemplates]] - default pmwiki pagelist templates%0a* [[Cookbook:PagelistTemplateSamples]] - contributed pagelist template samples%0a* [[(PmWiki/)PagelistVariables]] - ''local/config.php'' customizations%0a%0a%25trail%25 %3c%3c|[[Documentation Index]]|>>%0a%0a>>faq%3c%3c [[#faq]]%0a%0aQ: How can I configure my site to always exclude wiki-related pages from searches?%0aA: Try the following in your ''local/config.php file''.  See also [[Cookbook:SearchPatterns]].%0a%0a->[@%0a## Exclude Certain pages / groups from search results.%0a$SearchPatterns['default'][] = '!\\.(All)?Recent(Changes|Uploads|Comments)$!';%0a$SearchPatterns['default'][] = '!\\.Group(Print)?(Header|Footer|Attributes)$!';%0a$SearchPatterns['default'][] = '!\\.(Left|Right|Side)(Bar|Menu|Note)$!';%0a$SearchPatterns['default'][] = '!^Site\\.!';%0a$SearchPatterns['default'][] = '!^PmWiki\\.!';%0a@]%0a%0aIf you add [@$SearchPatterns['default']...@] to exclude groups and pages from pagelist and search output, you can ''include'' the omitted pages by using "list=all" in the pagelist or search parameters.
time=1153236071
