DokuWiki

It's better when it's simple

User Tools

Site Tools


plugin:pagelist

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
plugin:pagelist [2017-09-11 03:52] nosbigplugin:pagelist [2023-08-27 23:50] (current) – version upped andi
Line 1: Line 1:
-====== Pagelist Plugin ======+====== PageList Plugin ======
  
 ---- plugin ---- ---- plugin ----
-description: Lists pages in a nice looking table or unordered list.+description: Lists pages in a nice looking table or unordered list
 author     : Dokufreaks (previous authors: Matthias Schulte, Michael Hamann, Esther Brunner, Gina Häußge, Michael Klier) author     : Dokufreaks (previous authors: Matthias Schulte, Michael Hamann, Esther Brunner, Gina Häußge, Michael Klier)
 email      : freaks@dokuwiki.org email      : freaks@dokuwiki.org
 type       : syntax, helper type       : syntax, helper
-lastupdate : 2017-08-24 +lastupdate : 2023-08-27 
-compatible : rincewindadora belleweatherwaxbinkyponder stibbonshrundetritus, Frusterick Manners+compatible : RincewindAdora BelleWeatherwaxBinkyPonder StibbonsHrunDetritus, Frusterick Manners, Greebo, Hogfather, Igor, Jack Jackrum
 depends    :  depends    : 
 conflicts  : conflicts  :
Line 18: Line 18:
 donationurl:  donationurl: 
 ---- ----
 +
 +> **Update note**: In August 2023 the css styling is changed a bit. The specific styles for each cell are replaced by more general styles. Also all styles, except ''simplelist'', got an additional class ''plgn__pglist'' to target better this plugin with your own styling.
  
 ===== Description ===== ===== Description =====
Line 39: Line 41:
 ==== Flags ==== ==== Flags ====
  
-^ Setting ^ Default ^^ Alternative ^^ +^ Default flag                                                      |^ Alternative flag                                                                                                                                                    |Setting in\\ [[plugin:config|Config Manager]]  
-| ''style'' ^ ''default'' | table with horizontal lines ^ ''table'', ''list'' or ''simplelist'' | standard DokuWiki table or list style +^ ''default''     | table with horizontal lines                      ^ ''table'', ''list'' or ''simplelist''  | standard DokuWiki table or list style                                                                                       | ''style''                                      | 
-| ''showheader'' ^ ''noheader'' | hide the heading row of the pagelist table ^ ''header'' | show the header | +^ ''noheader''    | hide the heading row of the pagelist table       ^ ''header''                             | show the header                                                                                                             | ''showheader''                                 
-| ''showdate'' ^ ''date'' | show the creation or last modification date ^ ''nodate'' | hide the date +^ ''firsthl''     show the first headline                          ^ ''nofirsthl''                          | show the page name                                                                                                          | ''showfirsthl''                                | 
-| ''showuser'' ^ ''user'' | show creator or contributors ^ ''nouser'' | hide the user +^ ''date''        | show the creation or last modification date      ^ ''nodate''                             | hide the date                                                                                                               | ''showdate''                                   | 
-| ''showdesc'' ^ ''nodesc'' | hide the description ^ ''desc'' | show the description (from metadata) | +^ ''user''        | show creator or contributors                     ^ ''nouser''                             | hide the user                                                                                                               | ''showuser''                                   | 
-| ''showcomments'' ^ ''nocomments'' | hide the number of comments ^ ''comments'' | show the number of comments (if [[discussion|Discussion Plugin]] is installed) +^ ''nodesc''      | hide the description                             ^ ''desc''                               | show the description (from metadata)                                                                                        | ''showdesc''                                   
-| ''showtags'' ^ ''notags'' | hide the tags ^ ''tags'' | show the tags (if [[tag|Tag Plugin]] is installed) +^ ''nodiff''      no displaying of differences column              ^ ''showdiff''                           | displays the differences column with the diff icon linking to the corresponding diff page for each row                      | ''showdiff''                                   | 
-| ''showfirsthl'' ^ ''firsthl'' | show the first headline ^ ''nofirsthl''show the page name +^ ''nosummary''   | no summary of last edit                          ^ ''summary''                            | show summary of the last page edit                                                                                          | no setting                                     | 
-| ''rsort/sort''        ^ ''nosort''    | no sortation of pages ^ ''rsort/sort'' | sorts the pages (reverse) alphabetically by pagename | +^ ''nocomments''  | hide the number of comments                      ^ ''comments''                           | show the number of comments (if [[discussion|Discussion Plugin]] is installed)                                              | ''showcomments''                               | 
-| ''showdiff''        ^ ''missing''    no displaying of differences column ^ ''showdiff''displays the differences column with the diff icon linking to the corresponding diff page for each row |+^ ''notags''      | hide the tags                                    ^ ''tags''                               | show the tags (if [[tag|Tag Plugin]] is installed)                                                                          | ''showtags''                                   | 
 +^ ''noimage''     | show image of the page                           ^ ''image''                              needs [[pageimage|Pageimage Plugin]] installed. Can either be defined on page or image with same name as page will be used  | ''showimage''                                  | 
 +^ ''nosort''      | no sortation of pages                            ^ ''rsort/sort''                         | sorts the pages (reverse) alphabetically by pagename                                                                        | ''rsort/sort''                                 
 +^                 if only ''sort'' is set it will sorts by ''id''  ^ ''sortby=<property>''                  sort by the requested property. Info should be provided with ''addPage()'' or some info can be retrieved form metadata.     | ''sortby''                                     | 
 +^ ''limit=0''     list all given entries                           ^ ''limit=<number>''                     | Limits the number of entries to <number>. 0 = list all given items.                                                         | no setting                                     | 
 + 
 + 
 + 
 +The ''sortby=<property>'' flag uses the info directly from the data supplied (e.g. if used in another plugin), or tries to compile or retrieve it from metadata. It sorts default by ''id''. Next to the column names as used internally in the provided data, you can use ''pagename'' for using only the pagename part of the ''id'' thus ignoring the namespace part, or ''ns'' for sorting pages before equal named namespaces. ''title'' uses the first headline of a page. Other property names are: ''date'', ''user'', ''desc'', ''summary'', and if the respectively plugin is available: ''comments'', ''linkbacks'', ''tags'' and ''image''. If called in other plugins these can eventually add their own columns as well. 
  
 ==== Example ==== ==== Example ====
Line 64: Line 74:
 ^ ''style'' | List style (default, table, table/list, simplelist) | ^ ''style'' | List style (default, table, table/list, simplelist) |
 ^ ''showheader'' | Show table header | ^ ''showheader'' | Show table header |
 +^ ''showfirsthl''| Show the first headline instead of the page name |
 ^ ''showdate'' | Shows/hides the date column (hide, creation date, modification date) | ^ ''showdate'' | Shows/hides the date column (hide, creation date, modification date) |
 ^ ''showuser'' | Shows/hides the user column (hide, creator, contributors) | ^ ''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) | ^ ''showdesc'' | Shows/hides a short description taken from the first paragraph of a page (hide, max. 160 characters, max. 500 characters) |
 +^ ''showdiff'' | Displays a differences column with the diff icon linking to the corresponding diff page for each row |
 ^ ''showcomments'' | Shows/hides comments of a page (requires the [[plugin:discussion]] plugin) | ^ ''showcomments'' | Shows/hides comments of a page (requires the [[plugin:discussion]] plugin) |
-^ ''showlinkbacks'' | Shows/hides linkbacks of a page (requires the [[http://foosel.org/snippets/dokuwiki/linkback|linkback]] plugin) |+^ ''showlinkbacks'' | Shows/hides linkbacks of a page (requires the [[plugin:linkback]] plugin) |
 ^ ''showtags'' | Shows/hides tags of a page (requires the [[plugin:tag]] plugin) | ^ ''showtags'' | Shows/hides tags of a page (requires the [[plugin:tag]] plugin) |
 +^ ''showimage'' | Shows/hides the image column (requires the [[pageimage|Pageimage Plugin]]) |
 ^ ''sort''     | Sorts the pages alphabetically by pagename | ^ ''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 |+^ ''sortby''   Sort the page by the given property, e.g. ''id'', ''pagename'', ''ns'', ''title'', ''date'', ''desc'', ''user'' etc or columns from plugins |
  
 ===== Helper Plugin ===== ===== Helper Plugin =====
Line 78: Line 91:
  
 <code php> <code php>
-  $pages = array( +$pages = [ 
-    array('id' => 'wiki:dokuwiki')+    ['id' => 'wiki:dokuwiki']
-    array('id' => 'wiki:syntax')+    ['id' => 'wiki:syntax']
-  )+]
-  $pagelist =& plugin_load('helper', 'pagelist'); +$pagelist = $this->loadHelper('pagelist'); 
-  if (!$pagelist) return false; // failed to load plugin +if (!$pagelist) return false; // failed to load plugin 
-  $pagelist->startList(); +$pagelist->startList(); 
-  foreach ($pages as $page){+foreach ($pages as $page){
     $pagelist->addPage($page);     $pagelist->addPage($page);
-  +
-  $renderer->doc .= $pagelist->finishList();+$renderer->doc .= $pagelist->finishList();
 </code> </code>
  
Line 96: Line 109:
   $pagelist->startList('myclass');   $pagelist->startList('myclass');
 </code> </code>
 +
 +For more details, see [[plugin:pagelist:development|How to use Pagelist in your plugin]].
  
 ===== Bugs / Feature Requests ===== ===== Bugs / Feature Requests =====
Line 101: Line 116:
 Please report bugs or feature requests at the [[https://github.com/dokufreaks/plugin-pagelist/issues|Bug tracker]]. Please report bugs or feature requests at the [[https://github.com/dokufreaks/plugin-pagelist/issues|Bug tracker]].
  
-===== Further Resources ===== 
  
-  * [[https://github.com/dokufreaks/plugin-pagelist/tree/master|Git Repository]] 
-  * [[https://github.com/dokufreaks/plugin-pagelist/issues|Bug Tracker]] 
  
 ===== Changes ===== ===== Changes =====
Line 111: Line 123:
  
 ===== Localization ===== ===== Localization =====
 +Submit translation via the translation tool: https://translate.dokuwiki.org/plugin/pagelist
  
  
-===== 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? ((/lib/plugins/discussion/syntax/threads.php)) 
-<code> 
-            // show form to start a new discussion thread? 
-            if ($perm_create && ($this->getConf('threads_formposition') == 'bottom')) 
-//                $renderer->doc .= $this->_newThreadForm($ns); 
-            return true; 
- 
-</code> 
-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.  --- [[user>lupo49|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 ''<nowiki><div col3>{{topic>your flags here}}</div></nowiki>'' syntax.  --- [[user>Ashtagon|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! --- [[user>serenewaffles|serenewaffles]] //2012/01/07 22:18// 
->> I commented on the open bug on the tracker with explanation and pastebin  --- [[user>serenewaffles|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.  --- [[user>lupo49|M. S.]] //2012/01/07 22:58// 
- 
-==== Showing "Edit summary" ==== 
- 
-How to show the "edit summary" of the latest edit? // --- Flavius // 
- 
-> [[plugin:changes]]  --- [[user>lupo49|M. 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: 
- 
-<code> 
-  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)); 
-    } 
-</code> 
- 
- --- [[user>harald|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 ! 
- 
-[[user>martinus|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 : 
- <code>// MODIF : date </code> 
- 
-**link to source** : [[https://app.box.com/s/2svtvh19psqs3wee91y7|box.com]] 
- 
-[[user>sphaira|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... 
plugin/pagelist.1505094741.txt.gz · Last modified: 2017-09-11 03:52 by nosbig

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