%META:TOPICINFO{author="TWikiContributor" date="1143024652" format="1.1" reprev="1.20" version="1.1"}%
%META:TOPICPARENT{name="TopicFunction"}%
---+ Function: %TOPIC%
%FORMFIELD{"TopicDescription"}%

---++ Parameters
   * NAME: BlogEntry or BlogComment whose BlogComments are to be rendered

---++ Implementation
<verbatim>
%STARTINCLUDE%
*~~ <!-- %CALC{"$SET(commentCounter, 0)"}% -->
<div class="blogComments">
<a name="topComment"></a>
<div class="blogScroll">
~~~ <a href="#bottomComment" title="scroll down">&darr;</a>
~~~ <a href="#%BASEWEB%_<nop>%NAME%" title="scroll up">&uarr;</a>
~~~ </div>
%~~ COUNTCOMMENTS{"%BASEWEB%.%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="%SCRIPTURLPATH{"view"}%/%BASEWEB%/WebRssComments?name=%NAME%">RSS</a>
*~~  <a class="natFeedIcon blogFeedIcon" 
~~~     title="ATOM Feed for the Comments of this Entry"
~~~     href="%SCRIPTURLPATH{"view"}%/%BASEWEB%/WebAtomComments?name=%NAME%">ATOM</a>
~~~ </div>
~~~ 
%~~ DBQUERY{"TopicType='BlogComment' AND BlogRef='%NAME%'"
~~~        order="createdate"
~~~        separator=" "
~~~        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>"
~~~        footer="<style type=\"text/css\">
~~~          .blogScroll { 
~~~            $percntCALC{
~~~              \"$dollarIF($dollarNOT($dollarGET(commentCounter)),display:none)\"
~~~            }$percnt};
~~~           </style>"
~~~ }%
~~~ <a name="bottomComment"></a>
~~~ <div class="blogScroll">
~~~ <a href="#topComment" title="scroll up">&uarr;</a>
~~~ </div>
~~~ </div> 
*~~
%STOPINCLUDE%
</verbatim>

---++ Test
<div class="alt">
%DBCALL{"%TOPIC%" NAME="TestBlogEntry0"}%
</div>

%DBCALL{"RenderFunctionCallers"}%


<!--
   * Set ALLOWTOPICCHANGE = %MAINWEB%.BlogAdminGroup
   * Set SIDEBAR = Admin
   * Set SIDEBARARG = TopicFunction
-->


%META:FORM{name="TopicForm"}%
%META:FIELD{name="TopicType" attributes="M" title="TopicType" value="TopicFunction"}%
%META:FIELD{name="TopicDescription" attributes="M" title="TopicDescription" value="Renders all comments of a BlogEntry"}%
