Skip to content

Commit

Permalink
Item13246: Document the header/body/footer contexts.
Browse files Browse the repository at this point in the history
  • Loading branch information
gac410 committed Mar 25, 2017
1 parent 2484fbf commit 19ec615
Showing 1 changed file with 32 additions and 11 deletions.
43 changes: 32 additions & 11 deletions core/data/System/SkinTemplates.txt
@@ -1,4 +1,4 @@
%META:TOPICINFO{author="ProjectContributor" comment="" date="1443573973" format="1.1" version="1"}%
%META:TOPICINFO{author="ProjectContributor" comment="" date="1490476899" format="1.1" version="1"}%
%META:TOPICPARENT{name="Skins"}%
%STARTINCLUDE%
---+ Skin Templates
Expand Down Expand Up @@ -302,7 +302,28 @@ Next, there are a number of action-specific templates, such as =view.tmpl=,
the same name. Their purpose is to include =foswiki.tmpl=, and provide new,
page-specific, definitions of the blocks described above.

Several of the action-specific templates have _skinned_ versions, such as =view.print.tmpl= and =view.text.tmpl=. These skinned versions are used to view the page in a specific way - for printing, or as plain text, for example.
Several of the action-specific templates have _skinned_ versions, such as =view.print.tmpl= and =view.text.tmpl=.
These skinned versions are used to view the page in a specific way - for printing, or as plain text, for example.

---++++ Template processing

The templates that render topic text are typically broken up into 3 areas,
divided by a token =%<nop>TEXT%=.
<verbatim>
..header area before any topic text...
%TEXT% (will be substituted with topic text)
...footer area after the topic text...
</verbatim>

When the core expands the template, it happens in 3 phases
1 Macros are expanded and TML is rendered in the header area before the %<nop>TEXT% token, with context =header_text= set.
1 The topic text then has its macros expanded, and TML rendered with context =body_text= set. The results replaces the %<nop>TEXT% token.
1 Finally the footer area has it's macros expanded and TML rendered in the area after the %<nop>TEXT% token with context =footer_text= set.

The contexts - =header_text=, =body_text= and =footer_text= are not used by the Foswiki core, but can be used by extensions during macro expansion to
determine which part of the page is being processed.

---+++ Other important templates:

=messages.tmpl= is an important template; it provides the basic definitions of
all error and warning messages that Foswiki issues. These are defined using
Expand All @@ -328,12 +349,12 @@ see what PatternSkin defines.

%STOPINCLUDE%

%META:FILEATTACHMENT{name="oopsmore_diff_debug.gif" attr="h" comment="" date="1443573973" size="3205" user="ProjectContributor" version="1"}%
%META:FILEATTACHMENT{name="default.css.gz" attr="h" comment="" date="1443573973" size="2072" user="ProjectContributor" version="1"}%
%META:FILEATTACHMENT{name="base.css.gz" attr="h" comment="" date="1443573973" size="1331" user="ProjectContributor" version="1"}%
%META:FILEATTACHMENT{name="oopsmore_diff_sidebyside.gif" attr="h" comment="" date="1443573973" size="1994" user="ProjectContributor" version="1"}%
%META:FILEATTACHMENT{name="base_src.css" attr="h" comment="" date="1443573973" size="6780" user="ProjectContributor" version="1"}%
%META:FILEATTACHMENT{name="base.css" attr="h" comment="" date="1443573973" size="5196" user="ProjectContributor" version="1"}%
%META:FILEATTACHMENT{name="oopsmore_diff_sequential.gif" attr="h" comment="" date="1443573973" size="3464" user="ProjectContributor" version="1"}%
%META:FILEATTACHMENT{name="default_src.css" attr="h" comment="" date="1443573973" size="11093" user="ProjectContributor" version="1"}%
%META:FILEATTACHMENT{name="default.css" attr="h" comment="" date="1443573973" size="8209" user="ProjectContributor" version="1"}%
%META:FILEATTACHMENT{name="oopsmore_diff_debug.gif" attr="h" comment="" date="1490476899" size="3205" user="ProjectContributor" version="1"}%
%META:FILEATTACHMENT{name="default.css.gz" attr="h" comment="" date="1490476899" size="2072" user="ProjectContributor" version="1"}%
%META:FILEATTACHMENT{name="base.css.gz" attr="h" comment="" date="1490476899" size="1331" user="ProjectContributor" version="1"}%
%META:FILEATTACHMENT{name="oopsmore_diff_sidebyside.gif" attr="h" comment="" date="1490476899" size="1994" user="ProjectContributor" version="1"}%
%META:FILEATTACHMENT{name="base_src.css" attr="h" comment="" date="1490476899" size="6780" user="ProjectContributor" version="1"}%
%META:FILEATTACHMENT{name="base.css" attr="h" comment="" date="1490476899" size="5196" user="ProjectContributor" version="1"}%
%META:FILEATTACHMENT{name="oopsmore_diff_sequential.gif" attr="h" comment="" date="1490476899" size="3464" user="ProjectContributor" version="1"}%
%META:FILEATTACHMENT{name="default_src.css" attr="h" comment="" date="1490476899" size="11093" user="ProjectContributor" version="1"}%
%META:FILEATTACHMENT{name="default.css" attr="h" comment="" date="1490476899" size="8209" user="ProjectContributor" version="1"}%

0 comments on commit 19ec615

Please sign in to comment.