Decent Blogging using TWiki

Function: RenderFrontTeaser

Render a set of teasers where the first n are rendered verbosly

see: RenderFullTeaser, RenderBlogTeaser, RenderFrontPage

Parameters

  • FULL: number of full teasers
  • LIMIT: number of teasers
  • CAT: categories to extract
  • AUTHOR: extract postings of this author

Implementation

%STARTINCLUDE%
<noautolink>
<!--
%~~ CALC{"$SET(postings,
*~~
%~~   DBQUERY{
~~~      "TopicType=~'\bBlogEntry\b' AND
~~~       SubjectCategory=~'\b%CAT%\b' AND
~~~       State='enabled' AND
~~~       BlogAuthor='%AUTHOR%'
~~~      "
~~~      limit="%LIMIT%" separator=", " order="created" reverse="on"
~~~      web="%WEB%"
~~~   }%
~~~ )$IF($LISTSIZE($GET(postings))==0,$SET(postings,none))"}%
-->
</noautolink>
%~~ DBQUERY{
~~~    web="%WEB%"
~~~    topics="%CALC{"$GET(postings)"}%" 
~~~    limit="%FULL%" order="created" reverse="on" hidenull="on"
~~~    format="%DBCALL{"RenderFullTeaser" section="format" NAME="$topic"}%"
~~~ }%
%~~ DBQUERY{
~~~    web="%WEB%"
~~~    topics="%CALC{"$GET(postings)"}%" 
~~~    skip="%FULL%" limit="%LIMIT%" order="created" reverse="on" hidenull="on"
~~~    header="---+ Earlier Postings$n"
~~~    format="%DBCALL{"RenderBlogTeaser" section="format" NAME="$topic"}%"
~~~ }%
~~~ %DBCALL{"RenderBlogAuthorSwitch"}%
%STOPINCLUDE%

Test

5 years, 9 months ago in by [[_BlogPlugin.][]]
... more

Earlier Postings

5 years, 9 months ago in by [[_BlogPlugin.][]]
... more

5 years, 9 months ago in by [[_BlogPlugin.][]]
... more

Calls to 'RenderFrontTeaser'

TopicForm
TopicType: TopicFunction
TopicDescription: Render a set of teasers where the first n are rendered verbosly
r1 - 2005-11-09 - 14:32:42 - TWikiContributor
Copyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Linux® is the registered trademark of Linus Torvalds in the U.S. and other countries.
Atmel®, AVR® and others are registered trademarks or trademarks of Atmel Corporation or its subsidiaries.
All other trademarks are the property of their respective owners.