DokuWiki

It's better when it's simple

User Tools

Site Tools


plugin:tagfilter

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
Next revisionBoth sides next revision
plugin:tagfilter [2018-10-04 21:28] peterfromearthplugin:tagfilter [2020-10-14 13:43] tech@tormantil.com
Line 3: Line 3:
 ---- plugin ---- ---- plugin ----
 description: Allows to create custom dropdown fields to easily filter pages based on tags description: Allows to create custom dropdown fields to easily filter pages based on tags
-author     : lisps, coder@peterfromearth+author     : lisps, peterfromearth
 email      : coder@peterfromearth.de email      : coder@peterfromearth.de
 type       : syntax,action,helper type       : syntax,action,helper
-lastupdate : 2018-10-04 +lastupdate : 2020-02-19 
-compatible : Hrun+compatible : Greebo, "Frusterick Manners", "Elenor Of Tsort", Detritus
 depends    : tag, pagelist depends    : tag, pagelist
 conflicts  conflicts 
Line 20: Line 20:
 screenshot_img : https://github.com/lisps/tagfilter/raw/master/example/example1.png screenshot_img : https://github.com/lisps/tagfilter/raw/master/example/example1.png
 ---- ----
 +
 +===== What it Does =====
 +
 +This plugin takes tags that you have added with a tag category, using the tag plugin, and allows you to filter by the category, displaying the results using the pagelist plugin to control formatting.
  
 ===== Installation ===== ===== Installation =====
Line 29: Line 33:
 Search and install the plugin using the [[plugin:extension|Extension Manager]]. Refer to [[:Plugins]] on how to install plugins manually. Search and install the plugin using the [[plugin:extension|Extension Manager]]. Refer to [[:Plugins]] on how to install plugins manually.
  
-:!: **New code is there:** The author wrote new code to [[https://github.com/lisps/tagfilter | source repo]], but has not release it here. The new code __//**FIXES**//__ some bugs mentioned below by users. As of 19 Jun 2016, the newest code is of 3 Apr 2014but it might be buggy in UI. Instead, [[https://github.com/lisps/tagfilter/tree/0fffc57951872b47a4e0536cf3d3930a1d3cdaf3 | code of 2 Apr 2014]] is recommended, [[https://github.com/lisps/tagfilter/archive/0fffc57951872b47a4e0536cf3d3930a1d3cdaf3.zip | the URL of code's zip]] can be pasted in Manual Install of Extension Manager.+:!: **New code is there:** I fixed the download urlplease update. 
 ===== Examples/Usage ===== ===== Examples/Usage =====
 +
 +**The Basics**
 +
 +You must have added some tags with tag categories, see the [[plugin:tag]] plugin. There are formatted as follows:
 +
 +<code>{{tag>category1:tag1 category2:tag2}}</code>
 +
 +In the following examples there are two pages tagged as follows:
 +  * Page 1 ''<nowiki>{{tag>status:ready version:weatherwax}}</nowiki>''
 +  * Page 2 ''<nowiki>{{tag>status:start version:Angua}}</nowiki>''
 +
 +Tagfilter uses the tag categories to specify what to show as filters and you can also default the values. 
 +
 +This tag filter defaults the status to 'Ready', which is only used on Page 1, and the user can only select one value in the dropdown:
  
   {{tagfilter>Status=status:.*=status:ready|Version=version:.*&nouser&nodate}}   {{tagfilter>Status=status:.*=status:ready|Version=version:.*&nouser&nodate}}
      
 {{ https://github.com/lisps/tagfilter/raw/master/example/example1.png }} {{ https://github.com/lisps/tagfilter/raw/master/example/example1.png }}
 +
 +This tag filter defaults the status to 'Ready', which is only used on Page 1, but the user the user can only select multiple values in the dropdown:
  
   {{tagfilter>Status=status:.*=status:ready|Version=version:.*&nouser&nodate&multi}}   {{tagfilter>Status=status:.*=status:ready|Version=version:.*&nouser&nodate&multi}}
      
 {{ https://github.com/lisps/tagfilter/raw/master/example/example2.png }}   {{ https://github.com/lisps/tagfilter/raw/master/example/example2.png }}  
 +
 +This tag filter defaults the status to 'Ready', which is only used on Page 1, but uses the chosen parameter (not clear what this does):
  
   {{tagfilter>Status=status:.*=status:ready|Version=version:.*&nouser&nodate&chosen}}   {{tagfilter>Status=status:.*=status:ready|Version=version:.*&nouser&nodate&chosen}}
      
 {{ https://github.com/lisps/tagfilter/raw/master/example/example4.png }}  {{ https://github.com/lisps/tagfilter/raw/master/example/example4.png }} 
 +
 +This tag filter defaults the status to 'Ready', which is only used on Page 1, but uses the chosen (not clear what this does) and multiple parameters:
  
   {{tagfilter>Status=status:.*=status:ready|Version=version:.*&nouser&nodate&multi&chosen}}   {{tagfilter>Status=status:.*=status:ready|Version=version:.*&nouser&nodate&multi&chosen}}
Line 48: Line 73:
 {{ https://github.com/lisps/tagfilter/raw/master/example/example3.png }} {{ https://github.com/lisps/tagfilter/raw/master/example/example3.png }}
  
 +==== NEW TAGCOMPARE ====
 +Use tagcompare to compare tags between pages. 
 +You can select the page in columns and for each tag expression there will be a row.
 +
 +  {{tagcompare>Status=status:.*=status:ready|Version=version:.*}}
 +
 +[[https://drive.google.com/file/d/1Pa07W0Ez62Z-JSO2cT5y-rNdSMY05fYg/view|Example Link]]
  
 ===== Syntax ===== ===== Syntax =====
Line 61: Line 93:
     * ''multi'' enables multiselect of tags     * ''multi'' enables multiselect of tags
     * ''chosen'' enables the chosen plugin for tag searching     * ''chosen'' enables the chosen plugin for tag searching
-    * ''cache=<seconds>'' optional caching time +    * ''tagimage'' show image next to tagname in dropdown boxes. Needs ''chosen'' tag. If image is ''status:a'' image needs to be ''tags:status_a.[png|jpg|gif|jpeg]''. Namespace ''tags'' (where the images needs to be placed) is a admin setting (''nsTagImage''
-    * pagelist flags +    * ''pagesearch'' add an extra dropdown field at the beginning to search for the page itself. 
 +    * ''rsort'' enable revers sort of pages 
 +    * ''nolabels'' do not show labels 
 +    * ''noneonclear'' show no pages when nothing is selected 
 +    * ''excludeNs=<comma seperated list of namespaces>'' exclude specific namespaces 
 +    * ''withTags=<comma seperated list of tags>'' these tags must be present on all pages 
 +    * ''excludeTags=<comma seperated list of tags>'' these tags must not be present on all pages 
 +    * ''tagintersect'' a page needs all selected tags (//>2020-02-21//
 +    * ''count'' show the numbers of found pages 
 +    * ''tagcolumn=<tagexpr>'' show an additional column in pagelist reslut with the selected tags of the page (e.g. ''status:.*''
 +    * ''tagimagecolumn=<tagexpr>=<imagenamespace>'' show an additional column in pagelist result with an image defined through the tag. (e.g. with ''&tagimagecolumn=status.*=tags'' and the page has version:example as a tag, the image tags:example.[png|jpg|gif] will be used) 
 +    * [[plugin:pagelist]] flags 
  
  
Line 71: Line 114:
 | ''cache_age'' | How long should pages with tagfilter be cached (in seconds), 0 for no caching| | ''cache_age'' | How long should pages with tagfilter be cached (in seconds), 0 for no caching|
 | ''DropDownList_size'' | Number of items to show in classic multiple dropdown mode | | ''DropDownList_size'' | Number of items to show in classic multiple dropdown mode |
- 
-=== Change Log === 
- 
-  * **2013-10-25** 
-    * Initial release 
-  * **2013-11-27** 
-    * add some performance improvements 
-    * add cache option 
-    * remember selected tags on browser back-action 
- 
  
  
Line 91: Line 124:
 ===== FAQ ===== ===== FAQ =====
  
 +===== Development =====
 +
 +=== Change Log ===
 +
 +
 +[[https://travis-ci.org/lisps/tagfilter|{{  https://travis-ci.org/lisps/tagfilter.png?nocache|Build Status}}]]
 +
 +{{rss>https://github.com/lisps/tagfilter/commits/master.atom date}}
  
 ===== Discussion ===== ===== Discussion =====
Line 134: Line 175:
  
 >>I'm afraid I have to agree that the documentation needs improvement.  First you need a clear opening statement as to what the plugin does.  Then you should have a list of the options and flags with clear statements about how each works.  Then after explaining the options and flags give your examples.--- [[user>turnermm|Myron Turner]] //2015-12-18 12:39// >>I'm afraid I have to agree that the documentation needs improvement.  First you need a clear opening statement as to what the plugin does.  Then you should have a list of the options and flags with clear statements about how each works.  Then after explaining the options and flags give your examples.--- [[user>turnermm|Myron Turner]] //2015-12-18 12:39//
 +
 +>> I come back to this three years later, because of a question someone had on the forum, and I find that the documentation still is not clear enough. This looks like it could be useful but it shouldn't be a struggle to learn how to use it. For improvements I refer to my previous comment. --- [[user>turnermm|Myron Turner]] //2018-10-17 17:58//
  
 ==== Can you please provide an update for the latest DokuWiki release? ==== ==== Can you please provide an update for the latest DokuWiki release? ====
Line 195: Line 238:
  
 >Thanks for sharing, but your code seems bypass the ACL check, which might have security issue. The official new code's link was added in [[plugin:tagfilter#Installation| Installation]] section, which fixes the bug you mentioned to some degree, allowing you to filter tags without specifying namespace. But it still can not specify the root namespace, see [[https://github.com/lisps/tagfilter/issues/6 | this issue]]. >Thanks for sharing, but your code seems bypass the ACL check, which might have security issue. The official new code's link was added in [[plugin:tagfilter#Installation| Installation]] section, which fixes the bug you mentioned to some degree, allowing you to filter tags without specifying namespace. But it still can not specify the root namespace, see [[https://github.com/lisps/tagfilter/issues/6 | this issue]].
 +
 +==== Terminology & Description ====
 +
 +It is confusing because you refer to tag categories and the Tag plugin also uses the word 'category' but to describe what a tag is i.e. a categorisation of a page. It would be clearer if you use the term TagGroup.
 +
 +I also suggest that you change the syntax to remove the use of colon because this looks like a reference to a namespace. However, if you were to do this one would also need a way to apply a global edit for those that have implemented with colons.
 +
 +--- [[user>lizat|Liz T]] //2020-10-14 13:41//
 +
plugin/tagfilter.txt · Last modified: 2023-10-21 19:55 by Klap-in

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