Decent Blogging using TWiki

Function: RenderBlogComments

Renders all comments of a BlogEntry

Parameters

Implementation

%STARTINCLUDE%
*~~
<div class="blogComments">
<a name="topComment"></a>
<div class="blogScroll">
~~~ <a href="#bottomComment" title="scroll down">&darr;</a>
~~~ <a href="#%WEB%_<nop>%NAME%" title="scroll up">&uarr;</a>
~~~ </div>
%~~ COUNTCOMMENTS{"%WEB%.%NAME%"
~~~   hidenull="on"
~~~   header="<h2>"
~~~   single="One Comment" 
~~~   format="$count Comments"
~~~   footer="</h2>$n"
~~~ }%
<div class="blogEntryFeed">
~~~  <a class="natFeedIcon blogFeedIcon" 
~~~     title="RSS Feed for the Comments of this Entry"
~~~     href="%SCRIPTURL{"view"}%/%WEB%/WebRssComments?name=%NAME%">RSS</a>
*~~  <a class="natFeedIcon blogFeedIcon" 
~~~     title="ATOM Feed for the Comments of this Entry"
~~~     href="%SCRIPTURL{"view"}%/%WEB%/WebAtomComments?name=%NAME%">ATOM</a>
</div>
~~~ <!-- %CALC{"$SET(commentCounter, 0)"}% -->
%~~ DBQUERY{"TopicType='BlogComment' AND BlogRef='%NAME%'"
~~~        order="createdate"
~~~        format="<!-- $percntCALC{\"$dollarSETM(commentCounter, +1)\"}$percnt -->
~~~                <div class=\"blogComment
~~~                $percntCALC{\"$dollarIF(
~~~                              $dollarODD($dollarGET(commentCounter)),
~~~                              blogCommentOdd,
~~~                              blogCommentEven)\"}$percnt\">
~~~               %DBCALL{"RenderBlogComment" section="format"}%
~~~               <div class=\"blogSubComments\">
~~~                  $percntDBCALL{\"RenderSubComments\" NAME=\"$topic\"}$percnt
~~~               </div>
~~~               </div>"
~~~ }%
~~~
<a name="bottomComment"></a>
<div class="blogScroll">
~~~ <a href="#topComment" title="scroll up">&uarr;</a>
~~~ </div>
<style type="text/css">
.blogScroll { 
%~~ CALC{"$IF($NOT($GET(commentCounter)),display:none)"}%;
}
</style>
</div>
*~~ 
%STOPINCLUDE%

Test

Calls to 'RenderBlogComments'

TopicForm
TopicType: TopicFunction
TopicDescription: Renders all comments of a BlogEntry
r1 - 2005-11-11 - 22:17:56 - 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.