DokuWiki

It's better when it's simple

User Tools

Site Tools


plugin:pagelist

PageList Plugin

Compatible with DokuWiki

  • 2022-07-31 "Igor" yes
  • 2020-07-29 "Hogfather" yes
  • 2018-04-22 "Greebo" yes
  • 2017-02-19 "Frusterick Manners" yes

plugin Lists pages in a nice looking table or unordered list

Last updated on
2020-09-27
Provides
Syntax, Helper
Repository
Source

Description

The Pagelist Plugin takes a list of wiki pages and provides a nicely formatted table with information about them. The plug-in has a number of flags that can be used to control the information and format of the page list. The user can provide a list of specific page references as can some popular helper plugins such the Blog, Discussion, Editor, Tag, Task and Dir plugins.

Syntax

Just wrap a regular unordered list of internal links with the <pagelist> tag. You may provide specific internal page references or have plug-ins supply them as in the example below:

<pagelist&[flags]>
  * [[..:blog:|Blog Plugin]]
  * [[..:discussion:|Discussion Plugin]]
  * [[..:editor:|Editor Plugin]]
  * [[..:tag:|Tag Plugin]]
  * [[..:wrap|Wrap Plugin|This is shown in the description cell]]
</pagelist>
[flags] flags can be used to alter the appearance of the pagelist, flags optional

Flags

Setting in
Config Manager
Default flag Alternative flag
style default table with horizontal lines table, list or simplelist standard DokuWiki table or list style
showheader noheader hide the heading row of the pagelist table header show the header
showdate date show the creation or last modification date nodate hide the date
showuser user show creator or contributors nouser hide the user
showdesc nodesc hide the description desc show the description (from metadata)
showcomments nocomments hide the number of comments comments show the number of comments (if Discussion Plugin is installed)
showtags notags hide the tags tags show the tags (if Tag Plugin is installed)
showfirsthl firsthl show the first headline nofirsthl show the page name
rsort/sort nosort no sortation of pages rsort/sort sorts the pages (reverse) alphabetically by pagename
showdiff nodiff no displaying of differences column showdiff displays the differences column with the diff icon linking to the corresponding diff page for each row
image noimage show image of the page image needs Pageimage Plugin installed. Can either be defined on page or image with same name as page will be used

Example

<pagelist&header&comments>
    //an unordered list of pages to display//
</pagelist>

In the example above, pagelist will display information about the provided pages in a table with a header line and a comments column (if the Discussion Plugin is installed). The user (or a plugin) must supply the specific pages to display in the list.

Configuration

The plugin can be configured using the DokuWiki configuration manager available in the admin menu. The settings also apply to plugins which use the helper component of the pagelist plugin, like for example the archive component of the blog plugin.

style List style (default, table, table/list, simplelist)
showheader Show table header
showdate Shows/hides the date column (hide, creation date, modification date)
showuser Shows/hides the user column (hide, creator, contributors)
showdesc Shows/hides a short description taken from the first paragraph of a page (hide, max. 160 characters, max. 500 characters)
showcomments Shows/hides comments of a page (requires the discussion plugin)
showlinkbacks Shows/hides linkbacks of a page (requires the linkback plugin)
showtags Shows/hides tags of a page (requires the tag plugin)
sort Sorts the pages alphabetically by pagename
showdiff Displays a differences column with the diff icon linking to the corresponding diff page for each row
showimage Shows/hides the image column (requires the Pageimage Plugin

Helper Plugin

You can easily use the functionality of the Pagelist Plugin in your own plugins. Here is a basic code snippet:

$pages = [
    ['id' => 'wiki:dokuwiki'],
    ['id' => 'wiki:syntax'],
];
$pagelist = $this->loadHelper('pagelist');
if (!$pagelist) return false; // failed to load plugin
$pagelist->startList();
foreach ($pages as $page){
    $pagelist->addPage($page);
}
$renderer->doc .= $pagelist->finishList();

Since release 2017-08-24 the function startList() has got an optional parameter to specify a CSS class for adding it to the class of the table element:

  $pagelist->startList('myclass');

For more details, see How to use Pagelist in your plugin.

Bugs / Feature Requests

Please report bugs or feature requests at the Bug tracker.

Changes

Localization

Submit translation via the translation tool: https://translate.dokuwiki.org/plugin/pagelist

plugin/pagelist.txt · Last modified: 2022-09-07 20:36 by Klap-in

Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
CC Attribution-Share Alike 4.0 International Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki