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 revision Previous revision
Next revision
Previous revision
plugin:tagfilter [2018-10-18 22:06]
peterfromearth
plugin:tagfilter [2020-10-14 13:43] (current)
tech@tormantil.com
Line 6: Line 6:
 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 : Greebo, "Frusterick Manners", "Elenor Of Tsort", Detritus compatible : Greebo, "Frusterick Manners", "Elenor Of Tsort", Detritus
 depends    : tag, pagelist depends    : tag, pagelist
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 32: Line 36:
  
 ===== 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 77: Line 101:
     * ''withTags=<comma seperated list of tags>'' these tags must be present on all pages     * ''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     * ''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     * ''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:.*'')     * ''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)     * ''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)
-    * pagelist flags +    * [[plugin:pagelist]] flags 
  
  
Line 213: 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.1539893201.txt.gz ยท Last modified: 2018-10-18 22:06 by peterfromearth