Pagelist Template Samples

Summary: Custom templates for pagelists formats

Sample custom formats for (:pagelist:)


compact pagelist in one line.

[[#oneline]](:if ! equal {<$Group} {=$Group}:)
'''[[{=$Group}]] /''' \
(:if true:) | [[{=$FullName}|+]] \
(:pagelist fmt=PagelistTemplateSamples#oneline group=Main count=4:)


pagelist of titles for sidebar

[[#sidebar]](:if equal {<$Group}:)
(:if ! equal {<$Group} {=$Group}:)
* [[{=$FullName}|+]]
(:if equal {>$Group}:)
(:pagelist fmt=PagelistTemplateSamples#sidebar order=title group=Main count=4:)


pagelist of spaced page titles for sidebar, without group heading

[[#sidebartitles]](:if equal {<$Group}:)
* [[{=$FullName}|{=$Titlespaced}]]
(:if equal {>$Group}:)
(:pagelist fmt=PagelistTemplateSamples#sidebartitles group=Main count=4:)


forum topics in table format

(:if equal {<$Group}:)
(:table class=forum width="90%" :)
(:cell style="background:#e5e5ff;padding-left:5px" :)'''Topic'''
(:cell style="background:#e5e5ff;padding-left:5px" :)%thd%'''Last Posted''' 
(:cell style="background:#e5e5ff;padding-left:5px" :)%thd%'''By''' (:if:)
(:cellnr style="background:#eeeeff;padding-left:5px" :)[[{=$FullName}|+]] 
(:cell style="background:#eeeeff;padding-left:5px" :){=$LastModified}
(:cell style="background:#eeeeff;padding-left:5px" :)[[~{=$LastModifiedBy}]] 
(:if equal {>$Group}:)
(:pagelist fmt=PagelistTemplateSamples#forum order=-time group=Main count=4:)
Topic Last Posted By
RecentChanges September 25, 2017, at 03:36 PM Paty cruz
AllRecentChanges September 11, 2016, at 01:09 AM Petko
About This Site October 17, 2015, at 03:36 AM simon
HomePage May 18, 2014, at 11:11 PM simon

  • Using the pagelist option trail=<Group>.RecentChanges:
Use this option if you want to track the same contents as the real RecentChanges and you want a quicker rendering. If you do not use this option, the pagelist directive will read every page in your group which may take some time. This may also provide different information for pages modified externally to pmwiki. In either case, some info on deleted pages will not match the real RecentChanges.
  • Setting up a group for RecentChanges:
If you want to change the layout for RecentChanges for all your groups, you can create a group called RecentChanges and insert a pagelist in the GroupHeader. This pagelist would use the group={$Name} option. Thereafter, instead of looking at Foo.RecentChanges, one would go to RecentChanges.Foo instead to see the custom RecentChanges.


Include the first five lines of every page preceded by an edit link for that page

|| '''[[{=$FullName}]]''' - [[Edit -> {=$FullName}?action=edit]]||

(:include {=$FullName} lines=4:)

(:if ! equal {>$Group}:)
(:pagelist fmt=PagelistTemplateSamples#teasers group=Main count=4:)
Main.AboutThisSite - Edit

PmWiki is a WikiWikiWeb system developed by Patrick Michaud as a tool to support easy collaborative authoring and maintenance of web sites. PmWiki is freely available under the GNU General Public License (GPL). See the documentation index for more information.

Main.AllRecentChanges - Edit


Main.GroupAttributes - Edit

Main.HomePage - Edit

Welcome to PmWiki!

A local copy of PmWiki's


Include the first paragraph. This allows a more flexible way to get teasers.

%rfloat%[-more-] [[{=$FullName}|{=$Titlespaced}]]
(:include {=$FullName} para=1:)
(:if equal {>$Group}:)
(:title {$Title}:)(:if:)
(:pagelist fmt=PagelistTemplateSamples#headerinclude group=Main list=normal count=5:)

more About This Site PmWiki is a WikiWikiWeb system developed by Patrick Michaud as a tool to support easy collaborative authoring and maintenance of web sites. PmWiki is freely available under the GNU General Public License (GPL). See the documentation index for more information.

more Home Page Welcome to PmWiki!

more Wiki Sandbox Feel free to use this page to experiment with the Text Formatting Rules. Just click the "Edit Page" link at the bottom of the page.


A modification of the 'teasers' template showing how css elements can be used.

%define=leftborder border-left="2px solid #88f" margin-left="2px" padding="0 0 0 10px"%
>>leftborder<<(:include {=$FullName} lines=5:)

%right% [-[[{=$FullName}|Read More]]-]
(:if ! equal {>$Group}:)

(:pagelist fmt=PagelistTemplateSamples#articleteasers group=Main count=3:)

About This Site

PmWiki is a WikiWikiWeb system developed by Patrick Michaud as a tool to support easy collaborative authoring and maintenance of web sites. PmWiki is freely available under the GNU General Public License (GPL). See the documentation index for more information.

This site is running pmwiki-2.2.102.

Read More


* Skins.Light (diff) . . . September 11, 2016, at 01:09 AM by Petko: skin updated, but could be easier/faster


Read More



Include whole pages, with titles as links to the pages, separated by a horizontal rule underneath each page's content. An edit link is shown if the user is authorized as editor. The title header for each page also contains an anchor which is the same as the full page name, used for #includeToc below.

(:if auth edit:)
(:include {=$FullName}:)
(:if equal {>$Group}:)
(:title {$Title}:)(:if:)

For example, to include the Foo pages in a group:

(:pagelist group={$Group} name=Foo* order=title fmt=PagelistTemplateSamples#includeTitle:)


Build a table of contents for the included pages included by #includeTitle above.

* [[#{=$FullName}|{=$Title}]]

So, to include all the Foo pages in a group, starting with a table of contents:

(:pagelist group={$Group} name=Foo* order=title fmt=PagelistTemplateSamples#includeToc:)

(:pagelist group={$Group} name=Foo* order=title fmt=PagelistTemplateSamples#includeTitle:)


A bullet list of groups, with a link for listing the pages in that group.

(:if ! equal {=$Group} {<$Group}:)
* [[{=$Group}]] \
  ([[list pages -> {$Name}?action=search&q=group%3D{=$Group}]])
(:pagelist group=P* fmt={$Name}#groupsWithListLinks count=4:)


A list with group-names and titles (especially for a customized searchlist)

(:if ! equal {=$Group} {<$Group}:)

:[[{=$Group}/]] /:
: :[[{=$Group}/[[{=$Name} | + ]]
(:pagelist name=E* fmt=PagelistTemplateSamples#bygrouptitle count=8:)


This is a generalization of the #includefaq format. Include a section from a page which has an anchor with the same name as the current page your pagelist is on.

(:include {=$FullName}#{$Name}:)

So, for example, if I have an anchor here:

''Lorum ipsium...''

I do not speak Latin, dear.

Lorum ipsium...

I do not speak Latin, dear.

Then I could include only that section by doing this:

(:pagelist Group={$Group} Name={$Name} fmt=PagelistTemplateSamples#includeXref [[#{$Name}]]:)

Lorum ipsium...

I do not speak Latin, dear.


To include an extract of the page text around the search term, as Google does. This makes use of Cookbook:Excerpts and Cookbook:SearchQueryVariable without using Cookbook:SortByScore. You can make this format default for searches (and not pagelists, where it does nothing) by setting (:searchbox fmt=#excerpts:) on Site.Search

(:if ! equal {=$Group} {<$Group}:)

:'''[[{=$Group}/]]''' /:
: :[[{=$Group}/{=$Name}]]   {=$:Title} {=$:Summary} {=$Description}
-->%bgcolor=#DBDBDB border="1px dotted grey"%[-(:excerpts {=$Group}.{=$Name} {$SearchQuery}:)-]%%

{=$Group}? /
{=$Name}? {=$:Title} {=$:Summary} {=$Description}
(:excerpts {=$Group}.{=$Name} :)


In order to list all pages belonging to a particular category

(:if false:)
(:template defaults order=title:)
(:template first:)
!!! {{$$link}$Titlespaced}
(:template each:)
* [[{=$FullName}|{=$Titlespaced}]] [-({=$LastModified} - {=$LastModifiedSummary})-]

(:pagelist group=PmWiki fmt=#categorized list=normal count=6 link=Category.WikiFarms:)

(:pagelist group=Cookbook fmt=#categorized list=normal name=-Cookbook.{*$Name} link=Category.PageList:)

Wiki Farms

Page List


A simple bullet list of page names. Colored red if within last 7 days, blue if within last 30 days, green if older.

* (:if date {$TodayMinus7}..{$TodayYMD}
{=$LastModifiedYMD}:)%red%(:elseif date {$TodayMinus30}..{$TodayYMD}
{=$LastModifiedYMD}:)%blue%(:else:)%green%(:ifend:) [[{=$FullName}]] modified: {=$LastModifiedYMD}%%

colorbydate requires the following lines in config.php:

$FmtPV['$TodayMinus7'] = '"' . strftime("%Y-%m-%d", $Now-(7*24*60*60)) . '"';
$FmtPV['$TodayMinus30'] = '"' . strftime("%Y-%m-%d", $Now-(30*24*60*60)) . '"';
$FmtPV['$TodayYMD'] = '"' . strftime("%Y-%m-%d", $Now) . '"';
$FmtPV['$LastModifiedYMD'] = 'strftime("%Y-%m-%d", $page["time"])';

The output would look something like this (assuming it was run on 2008-07-13):

  • Test.PageB modified: 2008-05-04
  • Test.PageC modified: 2008-05-04
  • Test.PageConfig modified: 2008-05-10
  • Test.PageListAAA modified: 2008-07-13
  • Test.PagePass modified: 2008-04-30
  • Test.Pagestore2 modified: 2008-06-14


An attempt to display all groups with the current group expand to show all pages. The current group and page should be highlighted. Improvements to this template would be much appreciated. Rik Blok? November 07, 2009, at 01:52 PM

(:if1 false:)
(:template first {=$Group}:)
(:if2 group {=$Group} :)
* %sidehead% [[{=$Group}/]]
* [[{=$Group}/]]
(:template each:)
(:if2 equal {*$Group} {=$Group}:)
(:if3 name {=$FullName} :)
** (:comment Empty item so sidehead isn't applied to full list if this is first item :)
** %sidehead% [[{=$FullName}|{=$Titlespaced}]]
** [[{=$FullName}|{=$Titlespaced}]]
(:pagelist fmt=PagelistTemplateSamples#sidebarexpandthisgroup count=4:)


NOTE regarding (:pagelist fmt=#group count=4:)
The fmt=group or fmt=#group looks at all of the pages in all groups, the count is not counting the groups but the pages looked at. But only the groups get displayed, not the list of pages, even the procedure looks at all groups. This is the reason it takes a lot longer on this site. -- So don't use count= with fmt=groups, and don't use it as an example, since there are so many pages on the site here.
  • This recipe requires at least PmWiki version: 2.1.beta15


Ever get tired of a list of pages you KNOW you're just going to have to click and reload to edit anyway? Good for admin pages, behind the scenes, etc. XES September 06, 2017, at 09:56 AM

(:template defaults order=title:)
* %newwin%[[{=$FullName}|{=$Titlespaced}]] | [[{=$FullName}?action=edit|edit]] - %gray%{(ftime "%m/%d/%Y" {=$CTime})}%%
(:pagelist group=PmWiki name=-Draft fmt=PagelistTemplateSamples#editlist count=4:)
Note: with a slick little (:if auth edit:) trick this can be used on any normal #Titlespaced bullet list on your site and you can even use this idea to replace the standard lists on your site if desired — but only recommended on sites where you log in to edit.
(:template defaults order=title:)
* %newwin%[[{=$FullName}|{=$Titlespaced}]](:if auth edit:) | [[{=$FullName}?action=edit|edit]] - %gray%{(ftime "%m/%d/%Y" {=$CTime})}%%(:if:)


No need to have ugly group->pages lists. That's what titles are for. For wikis that actually use the Title attribute, have blogs, etc. XES September 06, 2017, at 09:56 AM

(:template first {=$Group}:)

(:template each:)
(:pagelist link=Category.Category group=-Cookbook fmt=#bygrouptitle count=6 list=normal:)

See Also



See discussion at PagelistTemplateSamples-Talk?