RenderTopicsOfCategory
renders topics of a category groupd by type

26 April 2024 - 07:16 | Version 1 |

Documentation

TODO

Parameters
  • cat
  • web
  • showfilter

Implementation

%STARTINCLUDE%%DBCALL{"%WEB%.%TOPIC%"
   section="%IF{
      "context SolrPluginEnabled"
      then="solr"
      else="dbstats"
   }%"
   cat="%cat{default="%URLPARAM{"catname" default="%BASETOPIC%"}%"}%"
   web="%ENCODE{"%web{default="%BASEWEB%"}%" old="/" new="."}%"
}%%STOPINCLUDE%

solr impl

%STARTSECTION{"solr"}%%SOLRSEARCH{
   "field_Category_flat_lst:%cat% -field_TopicType_lst:Category web:%web% type:topic"
   group="field_TopicType_first_s"
   grouplimit="9999"
   sort="field_TopicType_first_s asc"
   groupsort="title_sort asc"
   fields="web,topic"
   header_group="<h2>[[%web%.$groupValue]]</h2>$n<div class='clsMakeIndexWrapper'>
      %IF{"'%showfilter{default="%CLASSIFICATIONPLUGIN_SHOWFILTER{default="off"}%"}%'='on'"
         then="$dollarpercntDBCALL{\\"Applications.ClassificationApp.RenderCategory\\" section=\\"filter\\"}$dollarpercnt"
      }%<!-- -->
      <div class='group'>"
   format_group="<div class='fltMakeIndexItem'>$percntDBCALL{\"$web.$topic->RenderIndexItem\"}$percnt</div>"
   footer_group="</div></div>"
}%<style>
.group {
   column-gap:2em;
   column-width:18em;
}
</style>%ENDSECTION{"solr"}%

dbstats impl

%STARTSECTION{"dbstats"}%%DBSTATS{
   "('%cat%' DISTANCE topic) = 1 AND ! TopicType=~'\bCategory\b'"
   web="%web%"
   field="TopicType"
   process="$percntFORMATLIST{\"$value\" limit=\"1\"}$percnt"
   format="$percntDBCALL{\"%WEB%.%TOPIC%\" 
               section=\"topicindex\"
               topics=\"$topics\"
               type=\"$key\"
               cat=\"%cat%\"
               web=\"%web%\"
           }$percnt"
}%%ENDSECTION{"dbstats"}%

topicindex

%STARTSECTION{"topicindex"}%<h2 id='%type%'>[[%web%.%type%]]</h2>
%MAKEINDEX{
  "%DBQUERY{
   web="%web%"
   topics="%topics%"
   format="($expand(topictitle));$topic"
  }%"
  cols="%COLS{default="%CLASSIFICATIONPLUGIN_NRCOLS{default=""}%"}%"
  split="\n"
  pattern="\((.*)\);(.*)"
  sort="nocase"
  group=""
  format="$percntDBCALL{\"%web%.$2->RenderIndexItem\"}$percnt"
}%%ENDSECTION{"topicindex"}%%

Test

ERROR: DBCALL can't find topic RenderTopicsOfCategory in Applications/ClassificationApp

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 arbeitsgruppe.ch? Send feedback