Decent Blogging using TWiki

Function: RenderBlogLink

Renders a BlogLink ... 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

%STARTINCLUDE%
%~~ DBCALL{"RenderDocNavigation" 
~~~   NAME="%NAME%"
~~~   WHERE="TopicType=~'\bBlogLink\b'"
~~~   ORDER="Name"
~~~ }%
<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=\"$formfield(Refresh)\"
~~~         header=\"$percntDBCALL{\"%TOPIC%\" section=\"header\"}$percnt\"
~~~         format=\"$percntDBCALL{\"%TOPIC%\" section=\"article\"}$percnt\"
*~~      }$percnt
~~~      $percntELSEDEFINED$percnt
~~~      $n<!-- -->
~~~      $n| *Name:* | $formfield(Name) |
~~~      $n| *Headline:* | $formfield(Headline) |
~~~      $n| *Url:* | $formfield(Url) |
~~~      $n| *Category:* | $percntFORMATLIST{\"$formfield(SubjectCategory)\" sort=\"on\" format=\"[[$web.$1][$1]]\"}$percnt |
~~~      $n$n<div> *Comment:* $formfield(Comment)</div>
~~~      $percntFIDEFINED%
*~~      "
~~~ }%

</noautolink>
%~~ DBCALL{"RenderDocNavigation" 
~~~   NAME="%NAME%"
~~~   WHERE="TopicType=~'\bBlogLink\b'"
~~~   ORDER="Name"
~~~ }%
%STOPINCLUDE%

Header format

%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"}%

Article format

%STARTSECTION{"article"}%
*~~ <div class=\"headlinesArticle\">
*~~   <div class=\"headlinesTitle\">
*~~      <a href=\"$link\" target=\"_blank\">$title</a>
*~~   </div>
*~~   <hr/>
*~~   $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"}%

Test

Calls to 'RenderBlogLink'

TopicForm
TopicType: TopicFunction
TopicDescription: Renders a BlogLink
r1 - 2006-02-05 - 19:39:57 - 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.