/
RenderWikiTopicView.txt
57 lines (47 loc) · 2.44 KB
/
RenderWikiTopicView.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
%META:TOPICINFO{author="ProjectContributor" comment="" date="1409330208" format="1.1" version="1"}%
%META:TOPICPARENT{name="TopicFunction"}%
%TOC{depth="2"}%
---++ Documentation
%STARTSECTION{"documentation"}%
This function renders a view for a wiki topic,
showing its title and the summary line.
---+++ Parameters
* TITLE_EXTRA: optional addition put behind the topic title
* DISPLAYREVISIONINFO: boolean flag to switch on/off revinfo rendered underneath the h1 element
%ENDSECTION{"documentation"}%
---++ Implementation
<verbatim class="tml">
%STARTINCLUDE%<noautolink><h1>
%DBQUERY{topic="%BASEWEB%.%BASETOPIC%"
format="[[$web.$topic][<span itemprop='name'>$percntENCODE{\"$expand(topictitle)\" old=\"[,]\" new=\"[,]\"}$percnt</span>]] %IF{
"defined TITLE_EXTRA and not isempty TITLE_EXTRA"
then="<span class='foswikiTopicExtra'>%TITLE_EXTRA%</span>"}% $expand('<div itemprop=\"description\" class=\"foswikiTopicSummary\">' and Summary and '</div>')"
}%</h1>
%IF{"'%DISPLAYREVISIONINFO{default="on"}%'='on'"
then="$percntDBCALL{\"%WEB%.%TOPIC%\" section=\"revinfo\"}$percnt"
}%</noautolink>%STOPINCLUDE%
</verbatim>
---++ Revision Info
<verbatim class="tml">
%STARTSECTION{"revinfo"}%<span class="foswikiRevision">
%JQICON{"fa-calendar"}%
%REVINFO{"<span itemprop='dateModified' content='$iso'>$date - $hour:$min</span>" rev="%CURREV%" topic="%BASEWEB%.%BASETOPIC%"}%
<span class='foswikiRevisionSep'>|</span>
%JQICON{"fa-flag"}%
%MAKETEXT{"Version [_1]" args="%REVINFO{"<span itemprop='version'>$rev</span>" rev="%CURREV%" topic="%BASEWEB%.%BASETOPIC%"}%"}%
<span class='foswikiRevisionSep'>|</span>
%JQICON{"fa-user"}%
<span class='foswikiRevisionAuthor' itemprop='author'>%REVINFO{"[[$wikiusername]]" rev="%CURREV%" topic="%BASEWEB%.%BASETOPIC%"}%</span>
</span>%ENDSECTION{"revinfo"}%
</verbatim>
---++ Test
%DBCALL{"%TOPIC%" TITLE_EXTRA="(approved)"}%
%DBCALL{"Applications.RenderFunctionCallers"}%
---++ Copyright
© 2006-2014 Michael Daum http://michaeldaumconsulting.com
%DBCALL{"Applications.GnuGeneralPublicLicense" section="notice"}%
%META:FORM{name="Applications.ApplicationTopic"}%
%META:FIELD{name="TopicType" title="TopicType" value="DocuTopic, TopicFunction"}%
%META:FIELD{name="TopicTitle" attributes="" title="<nop>TopicTitle" value=""}%
%META:FIELD{name="Summary" attributes="c" title="Summary" value=""}%
%META:FIELD{name="WikiApplication" attributes="" title="WikiApplication" value="WikiWorkbench"}%