steptail.com

How many light bulbs does it take to change a penguin?

User Tools

Site Tools


wiki:pagelist

Pagelist Plugin

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 Default Alternative
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

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

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();

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');

Bugs / Feature Requests

Please report bugs or feature requests at the Bug tracker.

Further Resources

Changes

Localization

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

How to add two columns?

I want to add two columns for a plugin. But the function addColumn only support one column for one plugin. How can I do this?


need the same, very important!! — alfiox 2010-12-22


Also need. If the “list” layout used html “list” syntax instead of being buried inside a table with invisible lines, I think it could interact with the wrap plugin to make columns. — Ashtagon 2011-07-28


That is quite complicated with the current layout of the plugin. The data storage isn't built to fetch multiple columns of another plugin. — M. S. 2011/07/29 20:32

If the pagelist plugin (or more important for my needs, teh tag plugin, which I think uses the same engine) had an option to return an actual list rather than a table that contains cells which are rendered to look like a list, the problem could then be solved by passing this plugin's output through the wrap plugin's <div col3>{{topic>your flags here}}</div> syntax. — Ashtagon 2011/08/20 12:00
I went through the code. Inserting between 4 and 5 if statements that cause it to use an unordered list when $this→style == 'list' fixed it for me. I also had to ensure that it was only adding things when it should. But, overall, it wasn't that big of a deal. EDIT: I figured you guys would want to see it. Also, I am using the wrap plugin, so I edited helper.php to be compatible with that, it doesn't natively allow you to use multiple columns. http://pastebin.com/1HDytYdh WARNING: I only tested it using just the page name; I didn't use date or user or anything as I am using pagelist and tag to simulate the mediawiki category pages. YMMV and it might not work with other configs. Good luck! — serenewaffles 2012/01/07 22:18
I commented on the open bug on the tracker with explanation and pastebin — serenewaffles 2012/01/07 22:27
https://github.com/dokufreaks/plugin-pagelist/issues/15
Thanks for sharing your experiences. Could you please use the option “Minor Changes” when editing multiple times in a row, otherwise it generates a mail for every saving process. — M. S. 2012/01/07 22:58

Showing "Edit summary"

How to show the “edit summary” of the latest edit? — Flavius

changesM. S. 2011/02/15 19:03

pagelist: howto specify an additional argument for "date"-flag?

I would like to use pagelist together with “changes”-plugin to list those changes (within a namespace) that have been made on a specific date (e.g. 2011/01/13). How can i tell pagelist to do that? Thanks for help in advance! — Peter

Pick up descriptions from Description Plugin

If you want to pick up the Meta-fields from the Description Plugin you have to patch this function in the pagelist-plugin:

  function _descCell() {
            /*Begin patch to get meta data from plugin description */
	    $desc = $this->_getMeta(array('plugin_description','keywords')); 
	
	    if (!$desc)
            
            { /* end patch */
			  if (array_key_exists('desc', $this->page)) {
   			$desc = $this->page['desc'];
			} elseif (strlen($this->page['description']) > 0) {
				// This condition will become true, when a page-description is given
				// inside the syntax-block
				$desc = $this->page['description'];
			} else {
				$desc = $this->_getMeta(array('description', 'abstract'));
			}
                        
             } //close patch
        
        $max = $this->column['desc'];
        if (($max > 1) && (utf8_strlen($desc) > $max)) $desc = utf8_substr($desc, 0, $max).'…';
        return $this->_printCell('desc', hsc($desc));
    }

Harald 2014/01/19 22:27

pagelist: howto show parent namespace

I am using pagetag to display a list of pages that contain a given tag. As now, only the title of the page is displayed: additionally I want to display (at least) the first level containing namespace (ie: the parent). How do I do that ?

I have updated https://github.com/dokufreaks/plugin-pagelist/issues/26 with an example because I guess my request was not explicit enough !

martinus 2013/03/28 11:58

I made ​​additions to the plugin for my personal use, maybe it can help you.

The additions are:

  • Displays the parent namespace (with the title or name of the page) (flag: parentns or noparentns)
  • French translation

I do translations for English and French only. All changes are placed after the following pattern coment :

// MODIF : date 

link to source : box.com

Sphaira /2013/01/16 11:33

comments not updating

I am unsure if there is a conflict. I have pagelist control settings to how i want, however the comments don't seem to want to update when a comment is added.

omg

omg, devs no demo? no screenshots? 2016…

1)
/lib/plugins/discussion/syntax/threads.php
wiki/pagelist.txt · Last modified: 2018-04-07 01:22 by omolini