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 2009-04-27. Provides Syntax, Helper.
Compatible with DokuWiki 2009-04-14, 2008-05-05, rc2008-03-31, 2006-11-06.

Tagged with list, pages, tables.

Download

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

style.css enhancements

Here are some minor CSS enhancements (use fullwidth and avoid justification of pagenames like “Minutes 2008-05-05”). I'm too lazy to submit a bug report.

--- style.css	2008-04-12 20:36:37.000000000 +0200
+++ style.css.neu	2008-05-21 20:03:49.000000000 +0200
@@ -5,6 +5,8 @@
   border-spacing: 0;
   margin-bottom: 1em;
   border-collapse: collapse;
+  text-align: left;
+  width: 100%;
 }
 
 div.dokuwiki table.pagelist tr {
@@ -14,7 +16,7 @@
 
 div.dokuwiki table.pagelist th,
 div.dokuwiki table.pagelist td {
-  padding: 1px 1em 1px 0;
+  padding: 1px 1em 1px 10px;
 }
 
 div.dokuwiki table.ul th,
@@ -50,4 +52,4 @@
 
 div.dokuwiki td.date {
   text-align: right;
-}
\ Kein Zeilenumbruch am Dateiende.
+}
Do'h, what if I am to lazy to add this patch, huh? — Michael Klier 2008/05/24 18:03

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;

I have the discussion plugin installed, and want to show a page with available discussions, so

{{threads>*}}
~~DISCUSSION:off~~

should do the trick, but I get both the “create this page” and a discussion form below. The “create new page” can be suppressed in this very un-gently way shown above, but there is no way yet for disabling the discussion form.

Suggestions for “nicer fixes” are welcome, since I don't like hacking like this.


:!: I've never used the pagelist flags until today, but I just ran into this error when using the 'tags' flag:

Call to a member function td() on a non-object in /var/www/wiki/lib/plugins/pagelist/helper.php on line 330

I do have the tags plugin… Juice 2008-08-15

Please submit a bug report at the bug tracker listed on this page! Thanks! — Michael Klier 2008/08/15 20:37

Problems with default view

Hi, I have tried to install this plugin via both plugin manager and manually but, when I try to write a Pagelist in a page using the default view, I cannot see any line between each entry and, in Firefox, it even screws the layout of the section where the pagalist is, inserting a TAB-like space before each entry (this layout screwing part does not occur using Internet Explorer). I can provide an example page on my site if necessary. I am using the sidebar template. Thanks.

Example please :-). — Michael Klier 2008/10/08 13:04
Thanks for the reply. I have corrected my question. The lines suddenly appeared after cleaning the cache, so I think this was the cause of the first problem. Now I am stuck with the other problem which I re-report: in Firefox it screws the layout of the section where the pagalist is, inserting a TAB-like space before each entry (this layout screwing part does not occur using Internet Explorer). Here is an example page: http://universiruler.altervista.org/wiki/doku.php?id=test_page

Caching Problem ?

Firstly, pagelist is installed and working correctly - thanks for a nice plugin :-)

  1. I created a list <pagelist&table&header&firsthl&user&comments&nodesc> containing a set of internal links to pages that don't yet exist.
  2. I click on one of those links, create the new page and return to the page containing the pagelist.
  3. I force a page re-load (Ctrl + F5 in FF), but the link (to the now existing page) stays red and does not change to the 'firsthl' version.

If I edit the page containing the pagelist, save it (without any changes) and then re-load, then the link changes to the 'firsthl' version.

This looks like a caching issue to me. If I clear the DokuWiki cache (by deleting the contents of the data/cache/ folder) and refresh the page, then the links also update as expected.

I've tried adding ~~NOCACHE~~ to the page that contains the pagelist, but that makes no difference.

Update - changing the first header (once the page exists and the header shows in the list) gets shown in the pagelist as expected - it's only the initial page creation that appears to cause problems.

Is it possible to limit the number of pages shown ?

Great plugin indeed, maybe too powerful ;-)

Could there be a flag mentioning “only first X elements” ? — NewMorning 2009/02/03 07:21

How to display the user/date?

A great plugin. However, I cannot figure out how to display the creation/modification date and user under the default setting (date/user)

For example, how to generate

Thread 02 2008/06/11 20:39 My-Name 2 Comments

I tried the following, created the page “Thread 02”, and added 2 comments. But the date and users are not shown. The default setting of pagelist is used.

<pagelist>

</pagelist>

Thanks. David from Florida

1) /lib/plugins/discussion/syntax/threads.php
 
plugin/pagelist.txt · Last modified: 2009/06/02 07:42 by 128.227.27.183
 
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
WikiForumIRCBugsDarcsXRefTranslate