Documentation
Parameters
- NAME: name of the formfield to render the editor for
- VALUE: list of pre-selected tags
- THEWEB: current web
- THETOPIC: current topic
- SIZE: the size of the input field
Implementation
%STARTINCLUDE%<div class="clsTagEditor"><noautolink>
<input type="text" class="foswikiInputField jqTextboxList {autocomplete:'%SCRIPTURL{"rest"}%/RenderPlugin/template?topic=%THEWEB{default="%BASEWEB%"}%.%THETOPIC{default="%BASETOPIC%"}%;name=classificationplugin;expand=querytags'}" name="%NAME%" id="%NAME%" size="%SIZE%" value="%VALUE{default=""}%" />
%IF{"context SolrPluginEnabled" then="$percntDBCALL{\"%WEB%.%TOPIC%\" section=\"tagsuggestion\"}$percnt"}%
</noautolink></div>%STOPINCLUDE%
Tag suggestion via SolrPlugin
%STARTSECTION{"tagsuggestion"}%<!-- -->
%FORMATLIST{
"%SOLRSIMILAR{
"id:%THEWEB{default="%BASEWEB%"}%.%THETOPIC{default="%BASETOPIC%"}%"
like="category,tag"
facets="tag"
facetlimit="20"
facetmincount="5"
mindocumentfrequency="10"
rows="0"
filter="type:topic web:%THEWEB{default="%BASEWEB%"}%"
format_tag="$key=$count"
separator_tag=","
}%"
exclude="%FORMATLIST{"%VALUE%" split="\s*,\s*" format="\b($1=\d+)\b" separator="|" replace="-=\-,\[=\\[,\]=\\]"}%"
split="\s*,\s*"
pattern="(.*)=(.*)"
header="$n$n<hr />$n$n<h3>%MAKETEXT{"Related tags"}%:</h3><ol>"
format="<li><a class='clsTagSuggestion' href='#'>$1</a>
<span class='foswikiGrayText'>... %MAKETEXT{"found in [_1] other topic(s)" args="$2"}%</span>
</li>"
footer="</ol>"
separator="$n"
}%
<!-- -->%ENDSECTION{"tagsuggestion"}%
Test