RenderKnownCats
Returns a list of categories

02 May 2019 - 06:19 | Version 1 |

Documentation

This function is used in the category selector's autocompletion textboxlist to return a set of matching categories given the prefix in the url param q. See the classificationplugin.tmpl template file.

Parameters
  • CAT: pattern of categories to include, defaults to neutral filter; this pattern is to match the prefix of the category name
  • LIMIT: maximum number of categories to return, defaults to 10
  • THEWEB: web from which to extract category information, defaults to BASEWEB

Implementation

%STARTINCLUDE%%FORMATLIST{
  "%HIERARCHY{
    format="$name=$title|$title$n$children"
    web="%THEWEB{default="%BASEWEB%"}%"
    %IF{"defined CAT" then="include=\"^%CAT%.*\""}%
    matchattr="title"
    matchcase="off"
  }%"
  split="\n"
  sort="on"
  unique="on"
  separator="$n"
  limit="%LIMIT{default="10"}%"
}%%STOPINCLUDE%

Test

TestCategory0=TestCategory0|TestCategory0
TestCategory10=TestCategory10|TestCategory10
TestCategory11=TestCategory Eleven|TestCategory Eleven
TestCategory12=TestCategory12|TestCategory12
TestCategory13=TestCategory13|TestCategory13
TestCategory14=TestCategory Vierzehn|TestCategory Vierzehn
TestCategory15=TestCategory15|TestCategory15
TestCategory16=TestCategory16|TestCategory16
TestCategory2=TestCategory2|TestCategory2
TestCategory3=TestCategory3|TestCategory3

Copyright

© 2006-2019 Michael Daum http://michaeldaumconsulting.com

This file is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. For more details read the LICENSE.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY, to the extent permitted by law; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding Middle Fork Home Wiki? Send feedback
Syndicate this site RSS