Documentation
TODO
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", ...
Implementation
%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%
Test
%SOLRSEARCH{
" "
id="solrtagcloud1"
sort="date desc"
type="dismax"
fields=""
web=""
filter="type:topic web:
"
facets="tag"
facetlimit="100"
rows="100"
}%
%TAGCLOUD{
terms="%SOLRFORMAT{
"solrtagcloud1"
format_tag="$key:$count"
separator_tag=", "
}%"
header="
"
format="
$term"
footer="
"
group="
$group "
split="\s*,\s*"
buckets="20"
offset="11"
warn="off"
min="1"
}%
Copyright
© 2006-2013 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.