RenderRecentBlogEntries
display a list of recent BlogEntries for the sidebar

%REVINFO{ " $date - $hour:$min " rev=" IF{ "%NATMAXREV%!=%CURREV%" then="%CURREV%" }: Syntax error in '%NATMAXREV%!=%CURREV%' at '%NATMAXREV%!=%CURREV%' " topic="Applications/BlogApp.RenderRecentBlogEntries" }% | Version 1 |

Documentation

TODO

Parameters
  • LIMIT: maximal number of BlogEntries to list
  • CAT: optionally render restrict list to this category
  • THEWEB: blog web, defaults to BASEWEB

Implementation

%STARTINCLUDE%<noautolink>
%DBQUERY{
  "TopicType=~'\bBlogEntry\b' AND State != 'unpublished' AND topic != 'WebTopicEditTemplate' AND topic != '%BASETOPIC%'
   %IF{"defined CAT and '%CAT%'!=''" then="AND topic ISA '%CAT%'"}% 
  " 
  web="%THEWEB{default="%BASEWEB%"}%"
  order="publishdate" 
  reverse="on" 
  limit="%IF{"defined LIMIT" then="%LIMIT%" else="10"}%"  
  hidenull="on" 
  exclude="placeholder%CALCULATE{"$GET(seenEntries)"}%"
  header="<div class='blogSideBarSection blogSideBarRecent'> 
    <h2 >%IF{"defined CAT and '%CAT%'!=''"
        then="%TRANSLATE{"Latest in [_1]" args="%CATINFO{cat="%CAT%" format="$title"}%"}%"
        else="%TRANSLATE{"Latest"}%"
      }%</h2>
    <ul>"
  format="<li>
    <a href='%SCRIPTURLPATH{"view"}%/$web/$topic'>
      $percntDBCALL{\"Applications.RenderTopicThumbnail\" 
        OBJECT=\"$web.$topic\" 
        TYPE=\"plain\" 
      }$percnt $expand(topictitle)
      <br /><span class='foswikiTopicInfo foswikiSmallish'>$formfield(Summary)</span>
      %CLEAR%
    </a></li>"
  footer="</ul></div>"
}% 
</noautolink>%STOPINCLUDE%

Test

Calls to 'RenderRecentBlogEntries'

Copyright

© 2005-2019 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.
Warning: Can't find topic Applications/BlogApp.WebLeftBarExample

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 Foswiki? Send feedback