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.
| Download | plugin-pagelist.tgz |
|---|
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.
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 |
|---|
| 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 |
<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).
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) |
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();
You can try this plugin here.
Please report bugs or feature requests at the Bug tracker.
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
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
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
Firstly, pagelist is installed and working correctly - thanks for a nice plugin
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.
Great plugin indeed, maybe too powerful
Could there be a flag mentioning “only first X elements” ? — NewMorning 2009/02/03 07:21
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