Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Item14288: Merge 'origin/master'
  • Loading branch information
MichaelDaum committed Sep 21, 2017
2 parents b635eb4 + 8a292e6 commit 3d9656a
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 34 deletions.
48 changes: 25 additions & 23 deletions core/data/System/FAQViewTemplate.txt
@@ -1,19 +1,24 @@
%META:TOPICINFO{author="ProjectContributor" date="1394718135" format="1.1" version="1"}%
%META:TOPICINFO{author="ProjectContributor" date="1505958329" format="1.1" version="1"}%
%META:TOPICPARENT{name="FAQForm"}%
%{<verbatim class="tml">
===================================================
FAQ topic templates
===================================================
}%%{
---------------------------------------------------
Include the default view templates from your current SKIN and COVER paths
---------------------------------------------------
}%%TMPL:INCLUDE{"view"}%%{
---------------------------------------------------
Override the content template DEFinition. This normally just contains %TEXT%,
but we add some more here to help decorate all the [[FAQForm]] topics in the
same way
---------------------------------------------------
%{
---+ FAQ topic templates
This skin template is used to view FAQ questions and answers. It overrides the
content portion of the default view template, and removes the normal form
display, as the FAQForm data is included in the content.

<div class="foswikiHelp">%T% See %SYSTEMWEB%.SkinTemplates for more
information on this topic. The extraneous characters: =%<nop>{...}<nop>%= are
interpreted as comments when this topic is processed as a template.</div>

Include the default view templates from your current SKIN and COVER paths
<verbatim class="tml">
}%
%TMPL:INCLUDE{"view"}%%{
</verbatim>
Override the content template DEFinition. This normally just contains %TEXT%,
but we add some more here to help decorate all the [[FAQForm]] topics in the
same way.
<verbatim class="tml">
}%%TMPL:DEF{"content"}%
---+ Question: %FORMFIELD{"TopicSummary"}%
---++ Answer
Expand All @@ -22,13 +27,10 @@
*Back to:* [[%SYSTEMWEB%.%FORMFIELD{"TopicClassification"}%][%FORMFIELD{"TopicClassification"}%]]
----
*Related Topics:* %FORMFIELD{"RelatedTopics"}%%TMPL:END%%{
---------------------------------------------------
Re-define the form DEFinition to be empty; the contents of the from data
have already been displayed above so it wouldn't make much sense to show all
that again at the bottom of each [[FAQForm]] topic
---------------------------------------------------
</verbatim>
Re-define the form DEFinition to be empty; the contents of the from data
have already been displayed above so it wouldn't make much sense to show all
that again at the bottom of each [[FAQForm]] topic.
<verbatim class="tml">
}%%TMPL:DEF{"form"}%%TMPL:END%%{
===================================================
</verbatim>}%

%META:PREFERENCE{name="VIEW_TEMPLATE" title="VIEW_TEMPLATE" type="Set" value="SkinTemplateView"}%
6 changes: 3 additions & 3 deletions core/data/System/VarREVINFO.txt
@@ -1,14 +1,14 @@
%META:TOPICINFO{author="ProjectContributor" comment="reprev" date="1456498557" format="1.1" reprev="1" version="1"}%
%META:TOPICINFO{author="ProjectContributor" date="1505958329" format="1.1" version="1"}%
%META:TOPICPARENT{name="Macros"}%
---+ REVINFO -- revision information of current topic
=%<nop>REVINFO%= is equivalent to =%<nop>REVINFO{format="r1.$rev - $date - $wikiusername"}%=
---++ Examples
* =%<nop>REVINFO%= expands to =%REVINFO%=
* =%<nop>REVINFO{"format"}%= expands to =%REVINFO%=
* =%<nop>REVINFO{"$n * $topic: $date"}%= expands to %REVINFO{"$n * $topic: $date"}%
---++ Parameters
%TABLE{sort="off"}%
| *Parameter* | *Description* | *Default* |
| =format= | Format of revision information, see supported formatting tokens below | ="r$rev - $date - $wikiusername"= |
| ="format"= | Format of revision information, see supported formatting tokens below | ="r$rev - $date - $time - $wikiusername"= |
| =web= | Name of web | Current web |
| =topic= | Topic name | Current topic |
| =rev= | Specific revision number | Latest revision |
Expand Down
20 changes: 12 additions & 8 deletions core/data/System/VarSET.txt
@@ -1,19 +1,20 @@
%META:TOPICINFO{author="ProjectContributor" date="1434650530" format="1.1" version="1"}%
%META:TOPICINFO{author="ProjectContributor" date="1505958329" format="1.1" version="1"}%
%META:TOPICPARENT{name="Macros"}%
---+ SET -- set a preference setting during runtime
A preference setting created via %SET will only be usable on the topic where it has been found by the
parser, similar to normal [[preference settings]]. Each call to %INCLUDE opens a new scope for preference variables. An %INCLUDE of another topic containing a %SET statement will _not_
define those values in the including topic's scope. In contrast, a =TMPL:DEF= template definition
containing =%SET= macros will add those values to the current scope as if these settings have been
parsed as part of the current topic's text.
A preference setting created via a =%SET= macro is usable by the topic containing the =%SET= statement, and in any other topics =%INCLUDing= or =%INCLUDEd= when
rendering the topic TML. This is unlike list or META style [[preference settings]] which are only set when the base topic is loaded, and never set during macro expension when
an =%INCLUDEd= topic is processed.

A =TMPL:DEF= template definition containing =%SET= macros will also add those values to the current scope as if these settings have been
parsed as part of the base topic's text.

Setting a preference setting in a list like in

<verbatim class="tml">
* Set foo = %SEARCH{...
</verbatim>

will store the _text_ of the TML expression.
or in META settings will store the _text_ of the TML expression.

The equivalent %SET statement:

Expand All @@ -29,7 +30,10 @@ macros inside-out-left-to-right.
| ="name"= | Name of preference to set | |
| =value= | Value to set it to | |
---++ Examples
To cache the result of another macro use =%<nop>SET{"search_result" value="%<nop>SEARCH{...}%"}%=. The result of the =value= expression will be temporarily bound to the variable =%<nop>search_result%= and might be used within the scope of the current topic being processed
To cache the result of another macro use =%<nop>SET{"search_result" value="%<nop>SEARCH{...}%"}%=. The result of the =value= expression will be temporarily bound to the variable
=%<nop>search_result%= and might be used within the scope of the current topic being processed, or in =%INCLUDing= or other =%INCLUDEd= topics.

Note that this macro does NOT expand [[format tokens]] that are used to alter the macro processing sequence. ($percent, $dollar, ...).
%STOPINCLUDE%
---++ Related
PreferenceSettings
Expand Down

0 comments on commit 3d9656a

Please sign in to comment.