/
RenderIndexItem.txt
50 lines (44 loc) · 1.95 KB
/
RenderIndexItem.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
%META:TOPICINFO{author="ProjectContributor" comment="" date="1441719881" format="1.1" version="1"}%
%META:TOPICPARENT{name="TopicFunction"}%
%TOC{depth="2"}%
---++ Documentation
%STARTSECTION{"documentation"}%
This method is called by Applications.ClassificationApp.RenderCategory to display
a summary for an object. This method serves as a final fallback when no other TopicType-specific
method was found.
---+++++ Parameters
* OBJECT
%ENDSECTION{"documentation"}%
---++ Implementation
<verbatim class="tml">
%STARTINCLUDE%
%DBQUERY{topic="%OBJECT%"
format="<div class='clsIndexItem clsTopicItem'>
[[$web.$topic][$expand(topictitle)]] $percntREDDOT{\"$web.$topic\"}$percnt
$expand('<div class=\"foswikiTopicSummary\">' and Summary and '</div>')<!-- -->
<div class='foswikiTopicInfo'>
<span class='clsAuthorDateInfo'>
<!-- -->$formatTime(info.date)
<span class='foswikiRevisionSep'>|</span>
<nop>$percntGETTOPICTITLE{\"
$percntUSERINFO{\"$expand(info.author)\"
format=\"$wikiusername\"
}$percnt\"
}$percnt
</span>
$percntIF{\"'$expand(total_likes)'>0\"
then=\"<span class='foswikiRevisionSep'>|</span> <span class='clsLikeInfo'>$percntTRANSLATE{\"[quant,_1,like,likes]\" args=\"$expand(total_likes)\"}$percnt</span>\"
}$percnt<!-- -->
</div></div>"
}%
%STOPINCLUDE%
</verbatim>
---++ Test
<div class="alt">
%DBCALL{"%TOPIC%" OBJECT="%TOPIC%"}%
</div>
%META:FORM{name="TopicFunction"}%
%META:FIELD{name="TopicType" title="TopicType" value="TopicFunction, DocuTopic, ApplicationTopic, WikiTopic"}%
%META:FIELD{name="TopicTitle" title="<nop>TopicTitle" value=""}%
%META:FIELD{name="Summary" title="Summary" value="Fallback to render a summary for WikiTopic that does not have a type specific version of to render an index item"}%
%META:FIELD{name="WikiApplication" title="WikiApplication" value="WikiWorkbench"}%