You are here:
Foswiki
>
Applications/ClassificationApp Web
>
TopicType
>
TopicFunction
>
RenderSolrTagCloud
E
dit
A
ttach
Tags:
create new tag
,
view all tags
%TOC{depth="2"}% ---++ Documentation %STARTSECTION{name="documentation" type="section"}% %RED%TODO%ENDCOLOR% ---+++++ Parameters * DAYS: number of recent days of changes to take under consideration, defaults to unlimited * RECENCY: maximum number of topics to harvest tags from, defaults to 100 * LIMIT: maximum number of tags in the could, defaults to 100 * MIN: minimum frequency of a tags to be shown * TAG: comma separated list of tags to be searched for in the archive * CAT: restrict tag cloud to this category; displays all tags of all categories if unspecified * KEYWORDS: keywords to filter for * THEWEB: web to restrict search to, defaults to all * TYPE: content type to restrict results to, e.g. "topic", "image", "video", "pdf", "zip", ... %ENDSECTION{name="documentation" type="section"}% ---++ Implementation <verbatim class="tml"> %STARTINCLUDE%<!-- solrtagcloud --> %SOLRSEARCH{ "%IF{"defined KEYWORDS" then="%KEYWORDS%"}% " id="solrtagcloud1" sort="date desc" type="dismax" fields="" web="%IF{"defined THEWEB" then="%THEWEB%" else="all"}%" filter="type:topic %IF{"defined THEWEB and $THEWEB!='all'" then="web:%THEWEB%" }% %IF{"defined TAG" then="$percntFORMATLIST{\"%TAG%\" split=\"\*s,\s*\" format=\"tag:$1\" separator=\", \"}$percnt" }% %IF{"defined CAT" then="$percntFORMATLIST{\"%CAT%\" split=\"\*s,\s*\" format=\"category:$1\" separator=\", \"}$percnt" }% %IF{"defined TYPE" then="type:%TYPE%" }% %IF{"defined DAYS" then="date:\\"[NOW/DAY-%DAYS%DAY TO NOW]\\"" }%" facets="tag" facetlimit="%IF{"defined LIMIT" then="%LIMIT%" else="100"}%" rows="%IF{"defined RECENCY" then="%RECENCY%" else="100"}%" }%<!-- --> %TAGCLOUD{ terms="%SOLRFORMAT{ "solrtagcloud1" format_tag="$key:$count" separator_tag=", " }%" header="<div class='solrTagCloud clsTagCloud'>" format="<span style='font-size:$weightpx;line-height:110%'><a href='#' style='color:$fadeRGB(104,144,184,0,102,255);' class='solrFacetValue' name='tag_$term' value='$term'>$term</a></span>" footer="</div>" group="<strong>$group</strong> " split="\s*,\s*" buckets="20" offset="11" warn="off" min="%IF{"not isempty 'MIN'" then="%MIN%" else="1"}%" }% %ADDTOZONE{"script" tag="SOLRTAGCLOUD::JS" requires="JQUERYPLUGIN" text="<literal> <script> jQuery(function($) { $('.solrTagCloud a').click(function() { var $this = $(this), href = '%SCRIPTURL{"view"}%/%IF{"defined THEWEB and not isempty THEWEB and $THEWEB != 'all'" then="%THEWEB%" else="%BASEWEB%"}%/WebSearch'; href += '#fq=tag:'+escape($this.attr('value')); var tags = '%IF{"defined TAG" then="%TAG%"}%'.split(/\s*,\s*/); for (var i = 0; i < tags.length; i++) { if (tags[i] !='') { href += '&fq=tag:'+escape(tags[i])+''; } } var cats = '%IF{"defined CAT" then="%CAT%"}%'.split(/\s*,\s*/); for (var i = 0; i < cats.length; i++) { if (cats[i]!='') { href += '&fq=category:'+escape(cats[i]); } } window.location.href = href; return false; }); }); </script> </literal>" }% <!-- //solrtagcloud -->%STOPINCLUDE% </verbatim> ---++ Test %DBCALL{"%TOPIC%" THEWEB="%URLPARAM{"theweb"}%"}% %DBCALL{"Applications.RenderFunctionCallers"}% ---++ Copyright © 2006-2013 Michael Daum http://michaeldaumconsulting.com %DBCALL{"Applications.GnuGeneralPublicLicense" section="notice"}%
ApplicationTopic
edit
TopicType
DocuTopic
,
TopicFunction
TopicTitle
Summary
Renders a tag cloud using Solr
WikiApplication
ClassificationApp
E
dit
|
A
ttach
|
P
rint version
|
H
istory
: r1
|
B
acklinks
|
V
iew topic
|
Edit
w
iki text
|
M
ore topic actions
Topic revision: r1 - 07 Jan 2013,
ProjectContributor
Applications/ClassificationApp
Warning: Can't find topic Applications/ClassificationApp.WebLeftBarExample
Das Urheberrecht © liegt bei den mitwirkenden Autoren. Alle Inhalte dieser Kollaborations-Plattform sind Eigentum der Autoren.