Documentation

This function renders a view for a wiki topic, showing its title and the summary line.

Parameters

  • OBJECT: the topic to render the view for, defaults to %BASEWEB%.%BASETOPIC%
  • TITLE_EXTRA: optional addition put behind the topic title
  • DISPLAYREVISIONINFO: boolean flag to switch on/off revinfo rendered underneath the h1 element

Implementation

%STARTINCLUDE%<noautolink><h1 itemprop='headline'>
<a href="%DBQUERY{topic="%OBJECT{default="%BASEWEB%.%BASETOPIC%"}%" format="%SCRIPTURLPATH{"view"}%/$web/$topic"}%"><span itemprop='name'>%GETTOPICTITLE{topic="%OBJECT{default="%BASEWEB%.%BASETOPIC%"}%" rev="%URLPARAM{"rev"}%"}%</span></a> %IF{
   "defined TITLE_EXTRA and not isempty TITLE_EXTRA" 
   then="<span class='foswikiTopicExtra'>%TITLE_EXTRA%</span>"
}%%IF{
   "'%OBJECT{default="%BASEWEB%.%BASETOPIC%"}%'/Summary"
   then="<div class='foswikiTopicSummary'>$percntFORMFIELD{\"Summary\" topic=\"%OBJECT{default="%BASEWEB%.%BASETOPIC%"}%\" rev=\"%URLPARAM{"rev"}%\"}$percnt</div>"
}%</h1>
%IF{"'%DISPLAYREVISIONINFO{default="on"}%'='on'"
   then="$percntDBCALL{\"%WEB%.%TOPIC%\" OBJECT=\"%OBJECT%\" section=\"revinfo\"}$percnt"
}%</noautolink>%STOPINCLUDE%

Revision Info

%STARTSECTION{"revinfo"}%<span class="foswikiRevision">
   <span class='foswikiRevisionDate'>%JQICON{"fa-calendar"}%
      %REVINFO{
         "<a href='%SCRIPTURLPATH{"diff"}%/$web/$topic?rev=%CURREV{topic="%OBJECT{default="%BASEWEB%.%BASETOPIC%"}%"}%'>
            <span itemprop='dateModified' content='$iso'>$date - $hour:$min</span>
         </a>" 
         rev="%IF{"%NATMAXREV%!=%CURREV%" then="%CURREV%"}%" topic="%OBJECT{default="%BASEWEB%.%BASETOPIC%"}%"
      }%
  </span>
  <span class='foswikiRevisionSep'>&#124;</span>
  <span class='foswikiRevisionID'>
   %JQICON{"fa-flag"}%
   %MAKETEXT{"Version [_1]" args="%REVINFO{"<span itemprop='version'>$rev</span>" rev="%IF{"%NATMAXREV%!=%CURREV%" then="%CURREV%"}%" topic="%OBJECT{default="%BASEWEB%.%BASETOPIC%"}%"}%"}%
  </span>
  <span class='foswikiRevisionSep'>&#124;</span>
  <span class='foswikiRevisionAuthor' itemprop='author'>
   %JQICON{"fa-user"}%
   %REVINFO{
      "$percntIF{
         \"'$percntUSERINFO{\"$wikiname\"}$percnt'=''\"
         then=\"<nop>$wikiname\"
         else=\"[[$wikiusername][<span itemprop='name'>$percntGETTOPICTITLE{\"$wikiusername\"}$percnt</span>]]\"
      }$percnt"
      rev="%IF{"%NATMAXREV%!=%CURREV%" then="%CURREV%"}%" 
      topic="%OBJECT{default="%BASEWEB%.%BASETOPIC%"}%"}%</span> 
  %DBQUERY{"total_likes>0"
     topic="%OBJECT{default="%BASEWEB%.%BASETOPIC%"}%"
     format="<span class='foswikiRevisionSep'>&#124;</span> %JQICON{"fa-thumbs-o-up" class="fa-flip-horizontal"}% $expand(total_likes)"
  }%<!-- -->
</span>%ENDSECTION{"revinfo"}%

Test

RenderWikiTopicView (approved)

Calls to 'RenderWikiTopicView'

Copyright

© 2006-2013 Michael Daum http://michaeldaumconsulting.com

This file is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. For more details read the LICENSE.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY, to the extent permitted by law; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Das Urheberrecht © liegt bei den mitwirkenden Autoren. Alle Inhalte dieser Kollaborations-Plattform sind Eigentum der Autoren.