%META:TOPICINFO{author="TWikiContributor" date="1148970412" format="1.1" version="1.1"}%
%META:TOPICPARENT{}%
---+ Function: %TOPIC%
%FORMFIELD{"TopicDescription"}%
... displayed as a form gathering all information about this link or an aggregation
if the linked site has a nice rss feed.

---++ Parameters
   * NAME: topic name of an BlogLink
   * LIMIT: limit of articles to show

---++ Implementation
---+++ Main
<verbatim>
%STARTINCLUDE%
%~~ DBCALL{"RenderDocNavigation" 
~~~   NAME="%NAME%"
~~~   WHERE="TopicType=~'\bBlogLink\b'
*~~     %IFDEFINED{"%URLPARAM{"cat"}%" then=" AND SubjectCategory=~'\b$test\b'"}%"
~~~   ORDER="Name"
~~~   %IFDEFINED{"%URLPARAM{"cat"}%" then="PARAMS=\"cat=$test\""}%
~~~ }%
<noautolink>
%~~ DBQUERY{topic="%NAME%"
~~~   format="
~~~      $percntIFDEFINEDTHEN{\"$formfield(Feed)\" glue=\"off\"}$percnt
~~~      <div class=\"blogSubjectCategory\">
~~~      $percntFORMATLIST{\"$formfield(SubjectCategory)\" sort=\"on\" 
~~~        format=\"[[$web.$1][$1]]\"
~~~      }$percnt
~~~      </div>
~~~      <div> $formfield(Url) <p/>$formfield(Comment)</div>
~~~      $percntHEADLINES{
*~~         href=\"$formfield(Feed)\" 
~~~         limit=\"%LIMIT%\"
~~~         refresh=\"$percntIFDEFINED{\"$formfield(Refresh)\" else=\"%RSSREFRESH%\"}$percnt\"
~~~         header=\"$percntDBCALL{\"%TOPIC%\" section=\"header\"}$percnt\"
~~~         format=\"$percntDBCALL{\"%TOPIC%\" section=\"article\"}$percnt\"
*~~      }$percnt
~~~      $percntELSEDEFINED$percnt
~~~      $n<!-- -->
~~~      $n<table class=\"twikiTable\">
~~~      <tr><th>Name:</th><td> $formfield(Name) </td></tr>
~~~      <tr><th>Headline:</th><td> $formfield(Headline) </td></tr>
~~~      <tr><th>Url:</th><td> $formfield(Url) </td></tr>
~~~      <tr><th>Category:</th><td> 
~~~        $percntFORMATLIST{\"$formfield(SubjectCategory)\" 
~~~          sort=\"on\" 
~~~          format=\"[[$web.$1][$1]]\"
~~~        }$percnt</td></tr>
~~~      <tr><th>Comment:</th><td> $formfield(Comment) </td></tr>
~~~      </table>
~~~      $percntFIDEFINED%
*~~      "
~~~ }%

</noautolink>
%~~ DBCALL{"RenderDocNavigation" 
~~~   NAME="%NAME%"
~~~   WHERE="TopicType=~'bBlogLink\b'
*~~     %IFDEFINED{"%URLPARAM{"cat"}%" then=" AND SubjectCategory=~'\b%URLPARAM{"cat"}%\b'"}%"
~~~   ORDER="Name"
~~~   %IFDEFINED{"%URLPARAM{"cat"}%" then="PARAMS=\"cat=%URLPARAM{"cat"}%\""}%
~~~ }%
%STOPINCLUDE%
</verbatim>

---+++ Header format
<verbatim>
%STARTSECTION{"header"}%
*~~        <div class=\"headlinesChannel\">
*~~          <div class=\"headlinesLogo\">
*~~            <img src=\"$imageurl\" alt=\"$imagetitle\" border=\"0\"/><br/>
*~~            <from>
*~~              <input type=\"button\" style=\"color:blue\" value=\"Refresh\"
~~~              onclick=\"window.location.href='%SCRIPTURL%/view/%WEB%/$topic?refresh=on';\" />
*~~            </form>
*~~          </div>
*~~          <h1 class=\"headlinesTitle\">
*~~            <a href=\"$link\" target=\"_blank\">$title</a>
*~~          </h1>
*~~          <div class=\"headlinesDate\">
*~~           $percntCALC{\"$FORMATGMTIME($TIME($channeldate),
~~~              $wday, $day $mon $year, $hour:$minute)\"
*~~           }$percnt
*~~          </div>
*~~          <div class=\"headlinesDescription\">
*~~             $description
*~~          </div>
*~~          <div class=\"headlinesRight\">
*~~            $rights
*~~          </div>
*~~        </div>
*~~
%ENDSECTION{"header"}%
</verbatim>

<!--
*~~          <div class=\"headlinesRight\">$rights</div>
-->

---+++ Article format
<verbatim>
%STARTSECTION{"article"}%
*~~ <div class=\"headlinesArticle\">
*~~   <div class=\"headlinesTitle\">
*~~      <a href=\"$link\" target=\"_blank\">$title</a>
*~~   </div>
*~~   $percntIFDEFINEDTHEN{\"$date\"}$percnt
*~~   <div class=\"headlinesDate\">
*~~     $percntCALC{\"$FORMATGMTIME($TIME($date),
~~~       $wday, $day $mon $year, $hour:$minute)\"
*~~     }$percnt
*~~   </div>
*~~   $percntFIDEFINED$percnt
*~~   <div class=\"headlinesCreator\">$creator</div>
*~~   $percntIFDEFINEDTHEN{\"$subject\"}$percnt
*~~     <div class=\"headlinesSubject\"> \"$subject\"</div>
*~~   $percntFIDEFINED$percnt
*~~   <div class=\"headlinesTeaser\">$description</div>
*~~ </div>
*~~
%ENDSECTION{"article"}%
</verbatim>

---++ Test
<div class="alt">
%DBCALL{"%TOPIC%" NAME="BlogLink0" LIMIT="3"}%
</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="" title="TopicDescription" value="Renders a BlogLink"}%
%META:TOPICMOVED{by="MichaelDaum" date="1130169846" from="Blog.RenderNewsFeed" to="Blog.RenderBlogLink"}%
