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

see also: RenderBlogTeaser

---++ Parameters
   * NAME: BlogEntry topic name
   * PARAMS: additional urlparams that are added to the permalinks (optional)

---++ Implementation
---+++ Main
<verbatim>
%STARTINCLUDE%
~~~
%~~ DBQUERY{topic="%NAME%"
~~~   format="%DBCALL{"%TOPIC%" section="format"}%"
~~~ }%
~~~
%STOPINCLUDE%
</verbatim>

---+++ Format
<verbatim>
%STARTSECTION{"format"}%
*~~ <div class=\"blogEntry\">$n
~~~ %STOPALIASAREA%
~~~ <noautolink>
~~~ <table class=\"blogHeadline\" width=\"100%\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\">
~~~   <tr><td>
~~~   <h1>
~~~     <a href=\"$percntSCRIPTURLPATH{\"view\"}$percnt/$web/$topic
*~~       %IFDEFINED{"%PARAMS%" then="?%PARAMS%"}%\" 
~~~       title=\"permalink to <nop>$topic\">
~~~       $formfield(Headline)
*~~     </a>$percntREDDOT{\"$web.$topic\"}$percnt
~~~   </h1>$n
~~~   </td>
~~~   <td class=\"blogCommentCount\">
~~~     $percntCOUNTCOMMENTS{\"$web.$topic\" hidenull=\"on\"
~~~       format=\"<a href=\\"$dollarpercntSCRIPTURLPATH{\\"view\\"}$dollarpercnt/
*~~         $web/$topic#topComment\\" 
~~~         title=\\"comments on <nop>$topic\\">$dollarcount</a>\"
~~~     }$percnt
~~~   </td></tr>
~~~  </table>$n
~~~  </noautolink>
~~~  <div class=\"blogInfo\">
~~~    <span class=\"blogDate\">
~~~      $percntTIMESINCE{
~~~        \"$expand(Date)\"
~~~        format=\"$time ago\" 
~~~        null=\"about now\"
~~~      }$percnt
~~~    </span>
~~~    <span class=\"blogCategory\"> 
~~~    $percntFORMATLIST{\"$formfield(SubjectCategory)\" sort=\"on\" 
~~~      header=\"in <span class=\\"blogCategory\\">\"
~~~      format=\"<a href=\\"%SCRIPTURLPATH{"view"}%/$web/$1\\" rel=\\"tag\\">$1</a>\"
~~~      footer=\"</span>\"
~~~    }$percnt
~~~    <span class=\"blogAuthor\"> 
~~~      by [[$web.$formfield(BlogAuthor)][$formfield(BlogAuthor)]] 
~~~    </span>
~~~  </div>$n
~~~  <noautolink>$n
~~~  %STARTALIASAREA%
~~~  <div class=\"blogText\">
~~~    <div class=\"blogTeaser\">
~~~      $formfield(Teaser)
~~~    </div>
~~~    $formfield(Text)
~~~    <div class=\"blogMore\"> &#8230;&nbsp;
*~~      <a href=\"$percntSCRIPTURLPATH{\"view\"}$percnt/$web/$topic
*~~        %IFDEFINED{"%PARAMS%" then="?%PARAMS%"}%\" 
~~~        title=\"permalink to <nop>$topic\">reply</a>
~~~    </div>
~~~  </div>$n
~~~  %STOPALIASAREA%
~~~  </noautolink>
~~~  <br clear=\"all\" />
~~~ </div>
%ENDSECTION{"format"}%
</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="Render a BlogEntry for a FrontPage"}%
