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_PREFIX: optional string put before the topic title
- 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'>%IF{
"defined TITLE_PREFIX and not isempty TITLE_PREFIX"
then="<span class='foswikiTopicPrefix'>%TITLE_PREFIX%</span>"
}%<a href="%DBQUERY{topic="%OBJECT{default="%BASEWEB%.%BASETOPIC%"}%" format="%SCRIPTURLPATH{"view"}%/$web/$topic"}%"><span itemprop='name'>%TRANSLATE{"%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'>$percntTRANSLATE{\"$percntFORMFIELD{\"Summary\" topic=\"%OBJECT{default="%BASEWEB%.%BASETOPIC%"}%\" rev=\"%URLPARAM{"rev"}%\"}$percnt\"}$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'>|</span>
<span class='foswikiRevisionID'>
%JQICON{"fa-flag"}%
%TRANSLATE{"Version [_1]" args="%REVINFO{"<span itemprop='version'>$rev</span>" rev="%IF{"%NATMAXREV%!=%CURREV%" then="%CURREV%"}%" topic="%OBJECT{default="%BASEWEB%.%BASETOPIC%"}%"}%"}%
</span>
<span class='foswikiRevisionSep'>|</span>
<span class='foswikiRevisionAuthor' itemprop='author'>
%JQICON{"fa-user"}%
%REVINFO{
"$percntIF{
\"istopic '$wikiusername'\"
then=\"[[$wikiusername][<span itemprop='name'>$percntGETTOPICTITLE{\"$wikiusername\"}$percnt</span>]]\"
else=\"<nop>$wikiname\"
}$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'>|</span> %JQICON{"fa-thumbs-o-up" class="fa-flip-horizontal"}% $expand(total_likes)"
}%<!-- -->
</span>%ENDSECTION{"revinfo"}%
Test
%REVINFO{
"
$date - $hour:$min
"
rev="
IF{ "%NATMAXREV%!=%CURREV%" then="%CURREV%" }: Syntax error in '%NATMAXREV%!=%CURREV%' at '%NATMAXREV%!=%CURREV%'
" topic="Applications.RenderWikiTopicView"
}%
|
Version 1
|
ProjectContributor