RenderSideBar
sidebar for the blog app

28 January 2025 - 15:56 | Version 1 |

Documentation

TODO

Parameters
  • SIDEBAR: kind of sidebar to display

Implementation

%STARTINCLUDE%%DBCALL{
  "%WEB%.%TOPIC%" 
  section="%IF{"defined SIDEBAR" 
    then="%SIDEBAR%" 
    else="%FORMATLIST{"%FORMFIELD{"TopicType" topic="%BASEWEB%.%BASETOPIC"}%" limit="1" null="Default"}%"
  }%"
}%%JQREQUIRE{"serialpager"}%%STOPINCLUDE%

Default sidebar

%STARTSECTION{"Default"}%%DBCALL{"%WEB%.%TOPIC%" section="weblink"}%
<div class="blogSideBarSection blogAbout"> 
%WEBSUMMARY%
</div> 
%DBCALL{"Applications.BlogApp.RenderAuthorTools"
   initialdate="%DBQUERY{
      "TopicType=~'\bBlogEntry\b' 
       AND State='published'
       AND topic!='WebTopicEditTemplate'
       AND publishdate >= %URLPARAM{"time" default="0"}%
       AND publishdate < %DATETIME{"%URLPARAM{"time" default="%NOW%"}%" delta="in 1 month" lang="en" format="$epoch"}%
      "
      web="%BASEWEB%"
      sort="publishdate" 
      reverse="on"
      limit="1"
      format="$expand(publishdate)"
   }%"
}%<!-- -->
%DBCALL{"Applications.BlogApp.RenderRecentComments" 
  LIMIT="5" 
  %IF{"TopicType=~'Category'" 
    then="CAT=\"%URLPARAM{"catname" default="%BASETOPIC%"}%\""
  }%
}%<!-- -->
%DBCALL{"Applications.BlogApp.RenderCategories"}%<!-- -->
%DBCALL{"Applications.BlogApp.RenderArchives"}%<!-- -->
<!-- -->%ENDSECTION{"Default"}%

Admin sidebar

%STARTSECTION{"Admin"}%%DBCALL{"%WEB%.%TOPIC%" section="weblink"}%
<div class="blogSideBarSection blogAbout"> 
  <p>You are in the admin section. This area should only be accessible to admins of this blog.</p>
</div> 
%DBCALL{"Applications.BlogApp.RenderAuthorTools"}%<!-- -->
<!-- -->%ENDSECTION{"Admin"}%

Blog Entry sidebar

%STARTSECTION{"BlogEntry"}%%DBCALL{"%WEB%.%TOPIC%" section="weblink"}%
<div class="blogSideBarSection blogAbout"> 
%WEBSUMMARY%
</div> 
%DBCALL{"Applications.BlogApp.RenderAuthorTools" 
   initialdate="%DBQUERY{
      web="%BASEWEB%"
      topic="%BASEWEB%.%BASETOPIC%" 
      format="$expand(publishdate)"
   }%"
}%<!-- -->%IF{"context SolrPluginEnabled"
   then="$percntDBCALL{\"Applications.BlogApp.RenderSimilarBlogEntries\"}$percnt"
}%<!-- -->
%DBCALL{"Applications.BlogApp.RenderRecentBlogEntries"
  LIMIT="5"
  CAT="%CATINFO{topic="%BASEWEB%.%BASETOPIC%" format="$name" limit="1" exclude="TopCategory"}%"
}%<!-- -->%ENDSECTION{"BlogEntry"}%

Category sidebar

%STARTSECTION{"Category"}%%CATINFO{
   cat="%URLPARAM{"catname" default="%BASETOPIC%"}%" 
   format="<h2 >$title</h2>
<div class='blogSideBarSection blogAbout'> 
$summary
</div>"
}%
%DBCALL{"Applications.BlogApp.RenderAuthorTools"
   initialdate="%DBQUERY{
      "TopicType=~'\bBlogEntry\b' 
       AND State='published'
       AND topic!='WebTopicEditTemplate'
       AND topic ISA '%URLPARAM{"catname" default="%BASETOPIC%"}%'
       AND publishdate >= %URLPARAM{"time" default="0"}%
       AND publishdate < %DATETIME{"%URLPARAM{"time" default="%NOW%"}%" delta="in 1 month" lang="en" format="$epoch"}%
      "
      web="%BASEWEB%"
      sort="publishdate" 
      reverse="on"
      limit="1"
      format="$expand(publishdate)"
   }%"
}%<!-- -->
%DBCALL{"Applications.BlogApp.RenderCategories" CAT="%URLPARAM{"catname" default="%BASETOPIC%"}%"}%<!-- -->
%DBCALL{"Applications.BlogApp.RenderRecentComments" 
  CAT="%URLPARAM{"catname" default="%BASETOPIC%"}%" 
  LIMIT="5"
}%<!-- -->
%DBCALL{"Applications.BlogApp.RenderArchives"
  CAT="%URLPARAM{"catname" default="%BASETOPIC%"}%" 
}%<!-- -->%ENDSECTION{"Category"}%

%STARTSECTION{"weblink"}%%WEBLINK{ 
   format="<h2 class='webLink'><a class='$marker' href='$url'>$title</a></h2>"  
   web="%BASEWEB%" 
}%%ENDSECTION{"weblink"}%

Nosidebar

%STARTSECTION{"Nosidebar"}%%ENDSECTION{"Nosidebar"}%

Calls to 'RenderSideBar'

Copyright

© 2005-2025 Michael Daum

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.
This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding arbeitsgruppe.ch? Send feedback