%{ ###########################################################################
   template inheritance and general presets 
}%
%TMPL:INCLUDE{"view"}%

%{ ###########################################################################
   customization section
}%
%TMPL:DEF{"solr::defaultweb"}%all%TMPL:END%
%TMPL:DEF{"solr::instantsearch"}%false%TMPL:END%
%TMPL:DEF{"solr::defaultrows"}%10%TMPL:END%
%TMPL:DEF{"solr::defaultquerytype"}%edismax%TMPL:END%
%TMPL:DEF{"solr::defaultsort"}%score desc%TMPL:END%
%TMPL:DEF{"solr::dateformat"}%dddd, Do MMMM YYYY, HH:mm%TMPL:END%
%TMPL:DEF{"solr::fields"}%%TMPL:END%
%TMPL:DEF{"solr::extrafilter"}%%IF{
  "defined 'SOLR_EXTRAFILTER'" 
  then="%SOLR_EXTRAFILTER%" 
}% %IF{
  "not $USERNAME ingroup 'AdminGroup'"
  then="-web_search:Applications"
}%%TMPL:END%
%TMPL:DEF{"solr::facet::include::web"}%%TMPL:END%
%TMPL:DEF{"solr::facet::exclude::web"}%^(_.*%IF{
  "not $USERNAME ingroup 'AdminGroup'"
  then="|Application.*"
}%)$%TMPL:END%

%{ ###########################################################################
   content: main definition that puts together all pieces
}%
%TMPL:DEF{"content"}%<noautolink>
<div id='solrSearch' style='display:none' data-more-fields='%TMPL:P{"solr::fields"}%' data-solr-url='%SCRIPTURL{"rest"}%/SolrPlugin/proxy' data-solr-params='{"topic": "%WEB%.%TOPIC%", "qt":"%TMPL:P{"solr::defaultquerytype"}%", "rows": %TMPL:P{"solr::defaultrows"}%}' data-extra-filter='%TMPL:P{"solr::extrafilter"}%'>
%TMPL:P{"solr::title"}%<!-- -->
%TMPL:P{"solr::header"}%<!-- -->
%TMPL:P{"solr::hits"}%<!-- -->
%TMPL:P{"solr::footer"}%<!-- -->
%TMPL:P{"solr::assets"}%<!-- -->
</div>
%TMPL:P{"solr::templates"}%<!-- -->
%TMPL:P{"solr::dictionary"}%<!-- -->
</noautolink>%TMPL:END%

%{ ###########################################################################
   solr::assets - css and js to be added to the html head
}%
%TMPL:DEF{"solr::assets"}%<!-- -->
%JQREQUIRE{"livequery,focus, serialpager, scrollto, prettyphoto, render, jqtwisty, moment, blockui, imagetooltip"}%<!-- -->
%ADDTOZONE{"script"
  id="SOLRPLUGIN::AJAX"
  requires="JQUERYPLUGIN::LIVEQUERY, JQUERYPLUGIN::BLOCKUI, JQUERYPLUGIN::MOMENT"
  text="<script type='text/javascript' src='%PUBURLPATH%/%SYSTEMWEB%/SolrPlugin/ajax-solr.js'></script>
<script type='text/javascript' src='%PUBURLPATH%/%SYSTEMWEB%/SolrPlugin/ajax-solr-widgets.js'></script>
<script type='text/javascript' src='%PUBURLPATH%/%SYSTEMWEB%/SolrPlugin/ajax-solr-init.js'></script>"
}%<!-- -->
%ADDTOZONE{"head"
  id="SOLRPLUGIN"
  text="<link rel='stylesheet' href='%PUBURLPATH%/%SYSTEMWEB%/SolrPlugin/solrplugin.css' type='text/css' media='all' />"
}%<!-- -->%TMPL:END%

%{ ###########################################################################
   solr::dictionary - defines a set of keys to be displayed using a different lable
}%
%TMPL:DEF{"solr::dictionary"}%<literal>
<div class="solrDictionary solrJsonData" data-id="default">
{
  %FLEXWEBLIST{
    webs="public"
    exclude="Trash.*"
    format="\"$web\": \"$title\""
    subheader=",$n"
    separator=",$n"
  }%,
  "Filed in": "%MAKETEXT{"Filed in [_1]"}%",
  "Tagged": "%MAKETEXT{"Tagged [_1]"}%",
  "tagged": "%MAKETEXT{"tagged [_1]"}%",
  "field_TopicType_lst": "%MAKETEXT{"topic type"}%",
  "type": "%MAKETEXT{"media"}%",
  "date": "%MAKETEXT{"recently"}%",
  "language": "%MAKETEXT{"language"}%",
  "keyword": "%MAKETEXT{"keyword"}%",
  "tag": "%MAKETEXT{"tag"}%",
  "webcat": "%MAKETEXT{"Category"}%"%IF{"context MultiLingualPluginEnabled" 
    then="$percntLANGUAGES{
        header=\",$n\"
        format=\"  \\"$code\\":\\"$language\\"\"
        separator=\",$n\"
      }$percnt" 
  }%
}
</div>
</literal>%TMPL:END%

%{ ###########################################################################
   solr::templates - defines all jquery.tmpl templates required
}%
%TMPL:DEF{"solr::templates"}%<!-- -->
%TMPL:P{"solr::templates::hits"}%
%TMPL:P{"solr::templates::facetfield"}%
%TMPL:P{"solr::templates::currentselection"}%
%TMPL:P{"solr::templates::togglefacet"}%
%TMPL:P{"solr::templates::tagcloud"}%
%TMPL:P{"solr::templates::hierarchy"}%
%TMPL:P{"solr::templates::resultsperpage"}%
%TMPL:P{"solr::templates::spellcorrection"}%
<!-- -->%TMPL:END%

%{ ###########################################################################
   solr::templates::hits - defines all jquery.tmpl templates to render search hits
   of different types. each type has got a ...::<name-of-type> sup-template that
   is customized to that type.
}%
%TMPL:DEF{"solr::templates::hits"}%<!-- -->
%TMPL:P{"solr::templates::hits::topic"}%<!-- -->
%TMPL:P{"solr::templates::hits::image"}%<!-- -->
%TMPL:P{"solr::templates::hits::comment"}%<!-- -->
%TMPL:P{"solr::templates::hits::misc"}%<!-- -->
%TMPL:P{"solr::templates::hits::ClassifiedTopic"}%<!-- -->
<script id="solrHitTemplate" type="text/x-jsrender"> 
{{include tmpl=~getTemplateName() /}}
</script>%TMPL:END%

%TMPL:DEF{"solr::thumbnail"}%
{{if thumbnail}}
      <div class='solrThumbnail'>
        <a class='imageHref imageSimple jqImageTooltip {web:"{{:web}}", topic:"{{:topic}}", image:"{{:thumbnail}}"}' href='{{:url}}' title='{{:name}}'>
          <img src='%SCRIPTURLPATH{"rest"}%/ImagePlugin/resize?topic={{:web}}.{{:topic}};file={{:~encodeURIComponent(thumbnail)}};size=70>;crop=center' alt='{{:thumbnail}}' />
        </a>
      </div>
{{/if}}
%TMPL:END%

%TMPL:DEF{"solr::templates::hits::ClassifiedTopic"}%<script id="solrHitTemplate_ClassifiedTopic" type="text/x-jsrender">
  <div class='solrSearchHit solrTopicHit clearfix'>
    %TMPL:P{"solr::thumbnail"}%
    <h3>
      <img src='{{if icon}}{{:icon}}{{else}}%PUBURLPATH%/%SYSTEMWEB%/FamFamFamSilkIcons/page_white.png{{/if}}' width='16' height='16' />
      <a href='{{:url}}'>{{:title}}</a>
      <span class=' solrContainerLink foswikiGrayText foswikiSmallish'>
        %MAKETEXT{"in [_1]" args="<a href='{{:container_url}}'>{{:container_title}}</a>"}%
      </span>
    </h3>
    <div class='solrTopicInfo foswikiGrayText'>
      {{:~renderTopicInfo()}}
    </div>
    <div class='solrTopicSummary foswikiGrayText'>{{:summary}}</div>
    <div class='solrHilite'>
      {{:~getHilite(id)}}
    </div>
    <div class='solrRevision'> 
      {{:~formatDate(date,'%TMPL:P{"solr::dateformat"}%')}}, {{:author}}
    </div>
  </div>
</script>
%TMPL:END%

%TMPL:DEF{"solr::templates::hits::topic"}%<script id="solrHitTemplate_topic" type="text/x-jsrender">
  <div class='solrSearchHit solrTopicHit clearfix'>
    %TMPL:P{"solr::thumbnail"}%
    <h3>
      <img src='{{if icon}}{{:icon}}{{else}}%PUBURLPATH%/%SYSTEMWEB%/FamFamFamSilkIcons/page_white.png{{/if}}' width='16' height='16' class='solrHitIcon' />
      <a href='{{:url}}'>{{:title}}</a>
      <span class='foswikiGrayText foswikiSmallish solrContainerLink'>
        %MAKETEXT{"in [_1]" args="<a href='{{:container_url}}'>{{:container_title}}</a>"}%
      </span>
    </h3>
    <div class='solrHilite'>
      {{:~getHilite(id)}}
    </div>
    <div class='solrRevision'> 
      {{:~formatDate(date,'%TMPL:P{"solr::dateformat"}%')}}, {{:author}}
    </div>
  </div>
</script>%TMPL:END%

%TMPL:DEF{"solr::templates::hits::image"}%<script id="solrHitTemplate_image" type="text/x-jsrender">
  <div class='solrSearchHit solrImageHit clearfix'>
    <div class='solrImageFrame'>
      <a class='imageHref imageSimple jqImageTooltip {web:"{{:web}}", topic:"{{:topic}}", image:"{{:name}}"}' href='{{:url}}' title='{{:name}}'>
        <img src='%SCRIPTURLPATH{"rest"}%/ImagePlugin/resize?topic={{:web}}.{{:topic}};file={{:~encodeURIComponent(name)}};size=70>;crop=center' alt='{{:name}}' />
      </a>
    </div>
    <h3>
      <img src='{{if icon}}{{:icon}}{{else}}%PUBURLPATH%/%SYSTEMWEB%/FamFamFamSilkIcons/page_white.png{{/if}}' width='16' height='16' class='solrHitIcon' />
      <a href='{{:url}}'>{{:name}}</a>
      <span class='foswikiGrayText foswikiSmallish solrContainerLink'>
        %MAKETEXT{"in [_1]" args="<a href='{{:container_url}}'>{{:container_title}}</a>"}%
      </span>
      {{if comment}}
        <div class='foswikiGrayText foswikiSmallish solrSearchHitSummary'>{{:comment}}</div>
      {{/if}}
    </h3>
    <div class='solrHilite'>
      {{:~getHilite(id)}}
    </div>
    <div class='solrRevision'> 
      {{:~formatDate(date,'%TMPL:P{"solr::dateformat"}%')}}, {{:author}}
    </div>
    %CLEAR%
  </div>
</script>%TMPL:END%

%TMPL:DEF{"solr::templates::hits::comment"}%<script id="solrHitTemplate_comment" type="text/x-jsrender">
  <div class='solrSearchHit solrCommentHit'>
    <h3>
      <img src='%PUBURLPATH%/%SYSTEMWEB%/FamFamFamSilkIcons/comment.png' width='16' height='16' class='solrHitIcon' />
      <a href='{{:url}}'>{{:title}}</a>
      <span class='foswikiGrayText foswikiSmallish solrContainerLink'>
        %MAKETEXT{"in [_1]" args="<a href='{{:container_url}}'>{{:container_title}}</a>"}%
      </span>
    </h3>
    <div class='solrHilite'>
      {{:~getHilite(id)}}
    </div>
    <div class='solrRevision'> 
      {{:~formatDate(date,'%TMPL:P{"solr::dateformat"}%')}}, {{:author}}
    </div>
  </div>
</script>%TMPL:END%

%TMPL:DEF{"solr::templates::hits::misc"}%<script id="solrHitTemplate_misc" type="text/x-jsrender">
  <div class='solrSearchHit solrAttachmentHit'>
    <h3>
      <img src='{{if icon}}{{:icon}}{{else}}%PUBURLPATH%/%SYSTEMWEB%/FamFamFamSilkIcons/page_white.png{{/if}}' width='16' height='16' class='solrHitIcon' />
      <a href='{{:url}}'>{{:name}}</a>
      <span class='foswikiGrayText foswikiSmallish solrContainerLink' >
        %MAKETEXT{"in [_1]" args="<a href='{{:container_url}}'>{{:container_title}}</a>"}%
      </span>
      {{if comment}}
        <div class='foswikiGrayText foswikiSmallish'>{{:comment}}</div>
      {{/if}}
    </h3>
    <div class='solrHilite'>
      {{:~getHilite(id)}}
    </div>
    <div class='solrRevision'> 
      {{:~formatDate(date,'%TMPL:P{"solr::dateformat"}%')}}, {{:author}}
    </div>
  </div>
</script>%TMPL:END%

%TMPL:DEF{"solr::templates::facetfield"}%%TMPL:END% %{}%

%TMPL:DEF{"solr::templates::currentselection"}%<script id="solrCurrentSelectionTemplate" type="text/x-jsrender"> 
  <li>
    <table class='foswikiLayoutTable' width='100%'>
      <tr>
        <td width='12px'>
          <input type='checkbox' class='foswikiCheckbox' id='{{:id}}' name='filter' checked='checked'/>
        </td>
        <td>
          <label for='{{:id}}' style='display:block'>{{:facet}} <nobr>({{:field}})</nobr></label>
        </td>
      </tr>
    </table>
  </li>
</script>%TMPL:END%

%TMPL:DEF{"solr::templates::togglefacet"}%<script id="solrToggleFacetTemplate" type="text/x-jsrender"> 
  <input type='checkbox' class='foswikiCheckbox' id='{{:id}}' />
  <label class='foswikiLabel' for='{{:id}}'>{{:title}}</label>
</script>%TMPL:END%

%TMPL:DEF{"solr::templates::tagcloud"}%<script id="solrTagCloudTemplate" type="text/x-jsrender">
{{:group}}<span style='font-size:{{:weight}}px'><a href='#' title='{{:count}}' style='color:{{:color}};' class='solrFacetValue {{:current}} tag_{{:facet}}'>{{:facet}}</a> </span>
</script>%TMPL:END%

%TMPL:DEF{"solr::templates::hierarchy"}%<script id="solrHierarchyTemplate" type="text/x-jsrender">
<li><img src='{{:icon}}' width='16' height='16' /> <a href='#' class='solrFacetFalue cat_{{:id}}' data-value='{{:id}}'>{{:title}}</a> {{:~renderFacetCount(id)}}
<div class='solrHierarchyChildren'>
{{for ~getChildren}}
  {{if index < 5}}
    <a href='#' class='solrFacetValue' data-cat='cat_{{:id}}' data-value='{{:id}}'>{{:title}}</a>
  {{/if}}
{{/for}}
{{if ~getChildren().length >= 5}} 
  <a href='#' class='solrFacetFalue cat_{{:id}}' data-value='{{:id}}'>...</a>
{{/if}}
</div>
</li>
</script>%TMPL:END%

%TMPL:DEF{"solr::templates::resultsperpage"}%<script id="solrResultsPerPageTemplate" type="text/x-jsrender">
<table class="foswikiNullTable" width="100%">
  <tr>
    <td>
     {{if count > 0}}
       %MAKETEXT{"Results [_1] - [_2] of <b>[_3]</b>" args="{{:from}}, {{:to}}, {{:count}}"}%
     {{else}}
        <span class="foswikiAlert">%MAKETEXT{"nothing found"}%</span>
     {{/if}}
    </td>
    <td align="right">
      <table class="foswikiNullTable solrRows">
        <tr>
          <th>%MAKETEXT{"Results per page"}%:</th>
          <td>
            <select class="foswikiSelect">
              <option class="foswikiOption" value="5">5</option>
              <option class="foswikiOption" value="10">10</option>
              <option class="foswikiOption" value="20">20</option>
              <option class="foswikiOption" value="30">30</option>
              <option class="foswikiOption" value="40">40</option>
              <option class="foswikiOption" value="50">50</option>
              <option class="foswikiOption" value="100">100</option>
            </select>
          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
</script>%TMPL:END%

%TMPL:DEF{"solr::templates::spellcorrection"}%<script id="solrSpellCorrectionTemplate" type="text/x-jsrender">
%MAKETEXT{"Did you mean [_1]?" args="{{for suggestions}}{{if #index > 0}} or {{/if}} <a class='solrCorrection' href='#'>{{:#data}}</a>{{/for}}"}%
</script>%TMPL:END%

%{ ###########################################################################
   solr::header - header to be put infront of the search hits. this provides
   the containers for spellcheck corrections, pagination, counters and the like.
   It also calls the "solr::searchform" to display the search input field.
}%
%TMPL:DEF{"solr::header"}%<div class='solrHeader'>
%TMPL:P{"solr::searchform"}%
%TMPL:P{"DISsolr::hierarchystep"}%<!-- -->
%TMPL:P{"solr::spellchecker"}%
%TMPL:P{"solr::resultsperpage"}%
%TMPL:P{"solr::pager"}%
</div>%TMPL:END%

%TMPL:DEF{"solr::spellchecker"}%<div class='solrSpellchecking'></div>%TMPL:END%
%TMPL:DEF{"solr::resultsperpage"}%<div class='solrResultsPerPage'></div>%TMPL:END%
%TMPL:DEF{"solr::pager"}%<div class='solrPager' data-next-text="%MAKETEXT{"Next"}%" data-prev-text="%MAKETEXT{"Previous"}%" data-enable-scroll="%IF{"'%scroll%'=~'^(true|false)$'" then="%scroll%" else="false"}%" ></div>%TMPL:END%
%TMPL:DEF{"solr::footer"}%<div class='solrFooter'>%TMPL:P{"solr::pager" scroll="true"}%</div>%TMPL:END%

%{ ###########################################################################
   solr::searchform - this calls the separate steps comprising the form steps.
   this macro can be redefined to include more steps as needed.
}%
%TMPL:DEF{"solr::searchform"}%<!-- -->
%TMPL:P{"solr::formstart"}%
%TMPL:P{"solr::inputstep"}%
%TMPL:P{"solr::tagcloudstep"}%<!-- -->
%TMPL:P{"solr::formend"}%
<!-- -->%TMPL:END%

%{ ###########################################################################
   solr::formstart - beginning of the solr::searchform. contains the starting form 
}%
%TMPL:DEF{"solr::formstart"}%<!-- -->
<form name="searchform" class='solrSearchForm' id='solrSearchBox' data-instant-search='%TMPL:P{"solr::instantsearch"}%'>
<div class='foswikiFormSteps'>
<!-- -->%TMPL:END%

%{ ###########################################################################
   solr::inputstep - this is a part of the solr::searchform defining the 
   actual input field, as well as some basic select and checkboxes
}%
%TMPL:DEF{"solr::inputstep"}%<!-- -->
<div class='foswikiFormStep'>
<div class='foswikiLeft'>
<table class='foswikiNullTable'>
  <tr>
    <td>
      <input type='text' autocomplete='off' class='foswikiInputField jqFocus solrSearchField' size='50' style='margin-right:8px;' />
    </td>
    <td>
      %BUTTON{"%MAKETEXT{"Search"}%" type="submit" title="%MAKETEXT{"submit the query"}%" icon="find" class="solrSubmitButton"}%
    </td>
  </tr>
</table>
%TMPL:P{"solr::input::checkboxes"}%<!-- -->
</div>
<div class='foswikiRight'>
%TMPL:P{"solr::sortby"}%<!-- -->
%TMPL:P{"DISsolr::displayas"}%<!-- -->
</div>
%CLEAR%
</div>
<!-- -->%TMPL:END%

%{ ###########################################################################
   solr::formend - closing markup of the solr::searchform
}%
%TMPL:DEF{"solr::formend"}%<!-- -->
</div>
</form>
<!-- -->%TMPL:END%

%{ ###########################################################################
   solr::sidebar: this hooks into the skin to display all sidebar facets. the topmost
   widget is the "your selection" area displaying a summary of the current filters
   followed by the list of facets. Each facet is displayed calling the "facet" macro
}%
%TMPL:DEF{"solr::sidebar"}%<!-- -->
<noautolink>
%TMPL:P{"solr::selection"}%
</noautolink>
%TMPL:P{"solr::facet"
  id="web"
  class="solrWebFacetField"
  title="%MAKETEXT{"Web"}%"
  include="%TMPL:P{"solr::facet::include::web"}%"
  exclude="%TMPL:P{"solr::facet::exclude::web"}%"
  multivalue="true" 
  union="true" 
  exclusion="true" 
  sort="title" 
  limit="-1"
}%<!-- -->
%TMPL:P{"solr::facet"
  id="type"
  title="%MAKETEXT{"Media"}%"
}%
%TMPL:P{"solr::facetquery"
  id="date"
  exclusion="true" 
  title="%MAKETEXT{"Recent changes"}%"
  queries="[
      { \"key\": \"%MAKETEXT{"1 hour"}%\", \"value\": \"date:[NOW-1HOUR TO NOW]\" }, 
      { \"key\": \"%MAKETEXT{"4 hours"}%\", \"value\": \"date:[NOW-4HOUR TO NOW]\" },
      { \"key\": \"%MAKETEXT{"today"}%\", \"value\": \"date:[NOW/DAY TO NOW]\" },
      { \"key\": \"%MAKETEXT{"2 days"}%\", \"value\": \"date:[NOW/DAY-1DAY TO NOW]\" },
      { \"key\": \"%MAKETEXT{"7 days"}%\", \"value\": \"date:[NOW/DAY-7DAY TO NOW]\" },
      { \"key\": \"%MAKETEXT{"1 month"}%\", \"value\": \"date:[NOW-1MONTH TO NOW]\" },
      { \"key\": \"%MAKETEXT{"2 months"}%\", \"value\": \"date:[NOW-2MONTH TO NOW]\" },
      { \"key\": \"%MAKETEXT{"1 year"}%\", \"value\": \"date:[NOW-1YEAR TO NOW]\" },
      { \"key\": \"%MAKETEXT{"older"}%\", \"value\": \"date:[* TO NOW/YEAR]\" }
    ]"
}%
%TMPL:P{"solr::facet"
  id="field_TopicType_lst"
  exclude="ApplicationLicense|ApplicationTopic|DataForm|DocuTopic|TopicFunction|TopicStub|TopicTemplate|TopicType|TopicView|WebTool|WikiApplication|WikiTopic|TaggedTopic|CategorizedTopic"
  sort="title" 
  title="%MAKETEXT{"Topic type"}%"
}%
%TMPL:P{"solr::facet"
  id="state"
  title="%MAKETEXT{"Workflow State"}%"
}%
%TMPL:P{"solr::facet"
  id="preference_WORKFLOW_s"
  title="%MAKETEXT{"Workflow"}%"
}%
%TMPL:P{"solr::facet"
  id="language"
  title="%MAKETEXT{"Language"}%"
}%
%TMPL:P{"solr::facet"
  id="author"
  exclude="UnknownUser|AdminUser|RegistrationAgent|AdminGroup|WikiGuest|FoswikiContributor|ProjectContributor|TestUser"
  title="%MAKETEXT{"Author"}%"
}%
<!-- -->%TMPL:END%

%{ ###########################################################################
   solr::facet - format a facet for the given field id

   Parameters:
      * id - the field name of the facet, e.g. category, author
      * title - the heading 
      * multivalue - boolean
      * union - boolean
      * exclusion - boolean
      * sort - count or title
      * reverse - boolean
      * exclude - count or title
      * include - count or title
      * mincount - lower boundary for facet values to display
      * hidesingle - boolean
      * hidenullvalues - boolean
      * limit - max number of facet values to return
}%
%TMPL:DEF{"solr::facet"}%<div data-field='%id%' %IF{
  "not '%class%'=~'^([%]class%)?$'"
  then="class='%class%'"
  else="class='solrFacetField'"
}%%IF{
  "not '%hidesingle%'=~'^([%]hidesingle%)?$'"
  then=" data-hide-single='%hidesingle%'"
}%%IF{
  "not '%hidenullvalues%'=~'^([%]hidenullvalues%)?$'"
  then=" data-hide-null-values='%hidenullvalues%'"
}%%IF{
  "not '%multivalue%'=~'^([%]multivalue%)?$'"
  then=" data-multi-value='%multivalue%'"
}%%IF{
  "not '%union%'=~'^[%]union%$'"
  then=" data-union='%union%'"
}%%IF{
  "not '%exclusion%'=~'^([%]exclusion%)?$'"
  then=" data-exclusion='%exclusion%'"
}%%IF{
  "not '%sort%'=~'^([%]sort%)?$'"
  then=" data-facet-sort='%sort%'"
}%%IF{
  "not '%exclude%'=~'^([%]exclude%)?$'"
  then=" data-exclude='%exclude%'"
}%%IF{
  "not '%mincount%'=~'^([%]mincount%)?$'"
  then=" data-facet-mincount='%mincount%'"
}%%IF{
  "not '%limit%'=~'^([%]limit%)?$'"
  then=" data-facet-limit='%limit%'"
}%%IF{
  "not '%include%'=~'^([%]include%)?$'"
  then=" data-include='%include%'"
}%%IF{
  "not '%reverse%'=~'^([%]reverse%)?$'"
  then="data-facet-sort-reverse='%reverse%'"
}%>
<h2 class='jqTwisty' data-initial-state='open' data-open-img='%PUBURLPATH%/%SYSTEMWEB%/SolrPlugin/toggle-collapse.png' data-close-img='%PUBURLPATH%/%SYSTEMWEB%/SolrPlugin/toggle.png'>%title%</h2>
  <div class='solrFacetFieldContainer'></div>
</div>%TMPL:END%

%{ ###########################################################################
   solr::facetquery - format a facet query

   Parameters: 
      * id - the field name
      * title - the heading 
      * queries - json object of the form [ {"key":"some label", "value": "some query"}, ...]
      * multivalue - boolean
      * union - boolean
      * exclusion - boolean
}%
%TMPL:DEF{"solr::facetquery"}%<div class='solrFacetField' data-field='%id%' data-facet-type='facet_queries' %IF{
  "not '%multivalue%'=~'^([%]multivalue%)?$'"
  then=" data-multi-value='%multivalue%'"
}%%IF{
  "not '%union%'=~'^[%]union%$'"
  then=" data-union='%union%'"
}%%IF{
  "not '%exclusion%'=~'^([%]exclusion%)?$'"
  then=" data-exclusion='%exclusion%'"
}%>
  <literal>
  <div class="solrJsonData">%queries%</div>
  </literal>
  <h2 class='jqTwisty' data-initial-state='open' data-open-img='%PUBURLPATH%/%SYSTEMWEB%/SolrPlugin/toggle-collapse.png' data-close-img='%PUBURLPATH%/%SYSTEMWEB%/SolrPlugin/toggle.png'>%title%</h2>
  <div class='solrFacetFieldContainer'></div>
</div>%TMPL:END%

%{ ###########################################################################
   solr::facetrange - renders a range facet

   Parameters:
      * id - the field name
      * title - the heading 
      * start - start of range
      * end - end of range
      * gap - increment from start to end
      * other - TODO: look up solr docu
      * include - TODO: look up solr docu
      * dateformat - format string used when the facet goes over a date range
      * hidesingle - boolean
}%
%TMPL:DEF{"solr::facetrange"}%<div class='solrFacetField' data-field='%id%' data-facet-type='facet_ranges'%IF{
  "not '%start%'=~'^([%]start%)?$'"
  then=" data-facet-range-start='%start%'"
  else=" date-facet-range-start='NOW/DAY-7DAYS'"
}%%IF{
  "not '%hidesingle%'=~'^([%]hidesingle%)?$'"
  then=" data-hide-single='%hidesingle%'"
}%%IF{
  "not '%dateformat%'=~'^([%]dateformat%)?$'"
  then=" data-date-format='%dateformat%'"
}%%IF{
  "not '%end%'=~'^([%]end%)?$'"
  then=" data-facet-range-end='%end%'"
  else=" data-facet-range-end='NOW/DAY+1DAYS'"
}%%IF{
  "not '%gap%'=~'^([%]gap%)?$'"
  then=" data-facet-range-gap='%gap%'"
  else=" data-facet-range-gap='+1DAY'"
}%%IF{
  "not '%other%'=~'^([%]other%)?$'"
  then=" data-facet-range-other='%other%'"
  else=" data-facet-range-other='before'"
}%>
  <h2 class='jqTwisty' data-initial-state='open' data-open-img='%PUBURLPATH%/%SYSTEMWEB%/SolrPlugin/toggle-collapse.png' data-close-img='%PUBURLPATH%/%SYSTEMWEB%/SolrPlugin/toggle.png'>%title%</h2>
  <div class='solrFacetFieldContainer'></div>
</div>%TMPL:END%

%{ ###########################################################################
   solr::selection - renders the "your selection" part in the solr::sidebar
}%
%TMPL:DEF{"solr::selection"}%<!-- -->
<h2 class='solrFilterResultsHeading' >%MAKETEXT{"Filter results"}%</h2>
<div id='solrCurrentSelection'>
  <h3>%MAKETEXT{"Your selection"}%:</h3>
  <ul>
    <li class='solrNoSelection'>%MAKETEXT{"(none)"}%</li>
  </ul>
  <a href='#' class="solrClear">%MAKETEXT{"Clear"}%</a>
  <span class='foswikiClear'></span>
</div>
<!-- -->%TMPL:END%

%{ ###########################################################################
   solr::hits - display all search hits
}%
%TMPL:DEF{"solr::hits"}%<div class="solrSearchHits jqPrettyPhoto {itemSelector:'.solrImageFrame a'} clearfix" data-block-ui="window"></div>%TMPL:END%

%{ ###########################################################################
   solr::sortby - renders the sort interface
}%
%TMPL:DEF{"solr::sortby"}%<!-- -->
<table class='foswikiNullTable'>
  <tr>
    <th>%MAKETEXT{"Sort by"}%:&nbsp;</th>
    <td>
      <select class='foswikiSelect' id='solrSorting' data-default-sort="%TMPL:P{"solr::defaultsort"}%">
        <option class='foswikiOption' value='score desc'>%MAKETEXT{"Relevance"}%</option>
        <option class='foswikiOption' value='date desc'>%MAKETEXT{"Last changed"}%</option>
        <option class='foswikiOption' value='createdate desc'>%MAKETEXT{"Create date"}%</option>
        <option class='foswikiOption' value='title_sort asc'>%MAKETEXT{"Name"}%</option>
      </select>
    </td>
  </tr>
</table>
<!-- -->%TMPL:END%

%{ ###########################################################################
   solr::displayas - render the display switcher
}%
%TMPL:DEF{"solr::displayas"}%<!-- -->
<table class='foswikiLayoutTable'>
  <tr>
    <th>%MAKETEXT{"Display as"}%:</th>
    <td>
      <input type='radio' class='foswikiRadio solrDisplay' id='display_list' value='list' name='display'>
      <label class='foswikiLabel' for='display_list'>%MAKETEXT{"list"}%</label>
    </td>
    <td>
      <input type='radio' class='foswikiRadio solrDisplay' id='display_grid' value='grid' name='display'>
      <label class='foswikiLabel' for='display_grid'>%MAKETEXT{"grid"}%</label>
    </td>
  </tr>
</table>
<!-- -->%TMPL:END%

%{ ###########################################################################
   solr::input::checkboxes - some convenience checkbox selections under the input field
}%
%TMPL:DEF{"solr::input::checkboxes"}%<div class='solrCheckboxContainer'>
%IF{"'%TMPL:P{"solr::defaultweb"}%'='all'" 
  then="$percntTMPL:P{\"solr::input::checkboxes::incurrentweb\"}$percnt"
  else="$percntTMPL:P{\"solr::input::checkboxes::inallwebs\"}$percnt"
}%<!-- -->
%TMPL:P{"solr::input::checkboxes::inweb"}%<!-- -->
%TMPL:P{"solr::input::checkboxes::inmycontribs"}%<!-- -->
</div>%TMPL:END%

%{ ###########################################################################
   solr::input::checkboxes::inweb - display a "Search in current web only" checkbox
}%
%TMPL:DEF{"solr::input::checkboxes::incurrentweb"}%<!-- -->
<span class='solrToggleFacet' data-field='web' data-value='%FORMATLIST{"%BASEWEB%" split="/" separator="."}%' data-title='%MAKETEXT{"In current web"}%'></span>
<!-- -->%TMPL:END%

%{ ###########################################################################
   solr::input::checkboxes::inallwebs - display a "Search in all webs" checkbox
}%
%TMPL:DEF{"solr::input::checkboxes::inallwebs"}%<!-- -->
<span class='solrToggleFacet' data-field='web' data-value='%TMPL:P{"solr::defaultweb"}%' data-inverse='true' data-title='%MAKETEXT{"In all webs"}%'></span>
<!-- -->%TMPL:END%

%{ ###########################################################################
   solr::input::checkboxes::inmycontribs - display a "Search in my contribs" checkbox
}%
%TMPL:DEF{"solr::input::checkboxes::inmycontribs"}%<!-- -->
<span class='solrToggleFacet' data-field='contributor' data-value='%USERINFO{format="$wikiname"}%' data-title='%MAKETEXT{"In my contributions"}%'></span>
<!-- -->%TMPL:END%

%{ ###########################################################################
   solr::tagcloudstep - part of the solr::searchform. this contains the tagcloud facet
}%
%TMPL:DEF{"solr::tagcloudstep"}%<!-- -->
<div class='foswikiFormStep solrTagCloud' data-field='tag' data-start-color="[%TAGCLOUD_START{default="111, 169, 255"}%]" data-end-color='[%TAGCLOUD_END{default="0, 89, 224"}%]'>
  <div class='foswikiFormStep'>
    <hr />
    <h3><a href='#' class='jqTwisty' data-target='.solrTagCloudContainer' data-open-img='%PUBURLPATH%/%SYSTEMWEB%/SolrPlugin/toggle-collapse.png' data-close-img='%PUBURLPATH%/%SYSTEMWEB%/SolrPlugin/toggle.png'>%MAKETEXT{"Popular tags"}%</a></h3>
    <div class='solrTagCloudContainer tagCloud'></div>
  </div>
</div>

%{ ###########################################################################
   solr::hierarchystep - part of the solr::searchform. this contains the category list
}%
%TMPL:DEF{"solr::hierarchystep"}%<!-- -->
<div class='solrHierarchy' data-field='webcat' data-facet-sort='title'>
  <div class='solrHierarchyBreadcrumbs'>
    <span class='solrHierarchyBreadcrumbsTitle'>%MAKETEXT{"You are here:"}%</span>
    <span class='solrHierarchyBreadcrumbsContainer'></span>
  </div>
  <ul class='solrHierarchyContainer clearfix'></ul>
</div>

Contact Us

Atomikos Corporate Headquarters
Hoveniersstraat, 39/1, 2800
Mechelen, Belgium

E info@atomikos.com
E sales@atomikos.com
T +3215613055

Subscribe to our newsletter

Never miss an update

Copyright 2017 Atomikos BVBA