Pagelist Plugin

pagelist plugin by Gina Häußge, Michael Klier
Lists pages in a nice looking table or unordered list. (previous authors: Esther Brunner)

Last updated on 2010-01-07. Provides Syntax, Helper.
Compatible with DokuWiki 2009-12-25, 2009-02-14, 2008-05-05, rc2008-03-31, 2006-11-06.

Tagged with formatting, list, pages, tables.

Description

The Pagelist Plugin does – as its name says – list wiki pages in a nice way. Besides its function as a stand-alone syntax plugin, it serves as helper plugin for the Blog, Discussion, Editor, Tag, Task and Dir plugins.

Syntax

Just wrap a regular unordered list of internal links with the <pagelist> tag:

<pagelist&[flags]>
  * [[..:blog:|Blog Plugin]]
  * [[..:discussion:|Discussion Plugin]]
  * [[..:editor:|Editor Plugin]]
  * [[..:tag:|Tag Plugin]]
</pagelist>
[flags] flags can be used to alter the appearance of the pagelist, see flags optional

Flags

Setting Default Alternative
style default table with horizontal lines table or list 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

Example

<pagelist&header&comments>
...
</pagelist>

This will show a list of pages with a header line and a comments column (if the Discussion Plugin is installed).

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, list, table)
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)

Helper Plugin

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

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

Demo

You can try this plugin here.

Bugs / Feature Requests

Please report bugs or feature requests at the Bug tracker.

Further Resources

Changes

Discussion

This is a place for general plugin discussion. Please submit bugs and feature requests to bug tracker linked on this page.

Suppressing the new thread

Is it correct that I need to comment out the renderer if I want to prevent a “create this page” under the commentlist? 1)

            // show form to start a new discussion thread?
            if ($perm_create && ($this->getConf('threads_formposition') == 'bottom'))
//                $renderer->doc .= $this->_newThreadForm($ns);
            return true;

You should set the configuration option threads_formposition to off instead. — Phil 2010/01/29 16:05

Suggested additional option

Firstly, thanks for this plug-in.

Would it be possible to add an option to display the page name and the content of the first line, on the same line ?

For example :

<pagelist&pagename&firsthl>

Equivalent to :

<pagelist&nofirsthl&firsthl>

Desired Outcome :

MY_PAGE My_first_title Date User
1) /lib/plugins/discussion/syntax/threads.php
 
plugin/pagelist.txt · Last modified: 2010/02/03 12:10 by chi
 
Except where otherwise noted, content on this wiki is licensed under the following license:CC Attribution-Noncommercial-Share Alike 3.0 Unported
Imprint Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki
WikiForumIRCBugsGitXRefTranslate