SolrSideBar

This is a set of widgets to be used in a sidebar navigation. This is used like this:

%INCLUDE{"%SYSTEMWEB%.SolrSideBar"}%

You can also pick individual components using

%INCLUDE{"%SYSTEMWEB%.SolrSideBar" section="solrsimilar"}%

Note: all components make use of Foswiki:Extensions/DBCachePlugin for greater flexibility and performance.

Implementation

Default sidebar implementation that includes all of the components listed below.

%STARTINCLUDE%<noautolink>
<div class="solrSideBar">
%INCLUDE{"%WEB%.%TOPIC%" section="solrsimilar"}%<!-- -->
%INCLUDE{"%WEB%.%TOPIC%" section="recentchanges"}%<!-- -->
</div>
</noautolink>%STOPINCLUDE%

Component: "solrsimilar"

Renders a list of topics similar to the current one. This can be customized using the %SOLRSIMILAR_LIKE% preference variable set in your web's WebPreferences or on the current topic the sidebar is rendered for. See the documentation of %SOLRSIMILAR{}% part of the SolrPlugin documentation.

%STARTSECTION{"solrsimilar"}%<!-- -->
%SOLRSIMILAR{"id:%ENCODE{"%BASEWEB%" old="/" new="."}%.%BASETOPIC%" 
   filter="web:%ENCODE{"%BASEWEB%" old="/" new="."}% type:topic %IF{"defined FILTER" then="%FILTER%"}% -preference_BASETRANSLATION_s:%BASETOPIC% -webtopic:%ENCODE{"%BASEWEB%" old="/" new="."}%.%BASETRANSLATION{default=""}%"
   like="%SOLRSIMILAR_LIKE{default="field_Category_flat_lst^5,tag"}%"
   fields="web,topic,title,score,summary"
   rows="5"
   header="<h2 >%MAKETEXT{"Similar topics"}%</h2>$n<ul>" 
   footer="</ul>"
   format="<li>
       <a href='%SCRIPTURLPATH{"view"}%/$web/$topic' title='%MAKETEXT{"score: [_1]" args="$score"}%'>
         $percntDBCALL{\"$web.$topic->Applications.RenderTopicThumbnail\" 
            SIZE=\"40x40>\" 
            TYPE=\"plain\"
            CROP=\"west\"
         }$percnt <!-- -->$title
         <div class='foswikiGrayText'>$summary</div>
         %CLEAR%
       </a>
     </li>"
   separator="$n"
}%%ENDSECTION{"solrsimilar"}%

Component: "recentchanges"

Renders a list of the five most recent changes in the current web.

%STARTSECTION{"recentchanges"}%<!-- -->
%SOLRSEARCH{
  "web:%ENCODE{"%BASEWEB%" old="/" new="."}% type:topic %IF{"defined FILTER" then="%FILTER%"}% -topic:(WebHome OR WebLinks OR WebSideBar OR WebPreferences OR WebStatistics OR WebTopicList OR WebSearch OR WebIndex OR WebAdvancedSearch OR SitePreferences OR SiteHtmlHead)"
  sort="date desc" 
  rows="5"
  fields="web,topic,title,summary"
  header="<h2 >%MAKETEXT{"Recent Changes"}%</h2>$n<ul>"
  footer="</ul>"
  format="<li>
      <a href='%SCRIPTURLPATH{"view"}%/$web/$topic'>
        $percntDBCALL{\"$web.$topic->Applications.RenderTopicThumbnail\" 
           SIZE=\"40x40>\" 
           TYPE=\"plain\"
           CROP=\"west\"
        }$percnt<!-- -->$title
        <div class='foswikiGrayText'>$summary</div>
        %CLEAR%
      </a>
    </li>"
}%%ENDSECTION{"recentchanges"}%
Topic revision: r1 - 31 Jan 2019, UnknownUser
This site is powered by FoswikiCopyright © by the contributing authors. All material on this site is the property of the contributing authors.
Ideas, requests, problems regarding DAMASK? Send feedback