Foundry documentation

git-svn-id: https://svn.libreccm.org/ccm/trunk@2992 8810af33-2d31-482b-a856-94f89814c4df
master
jensp 2014-11-26 16:41:03 +00:00
parent 32724885dc
commit 7a4114e741
15 changed files with 503 additions and 69 deletions

View File

@ -3,7 +3,7 @@
<foundry:doc-chapter chapter-id="overview" <foundry:doc-chapter chapter-id="overview"
chapter-title="Overview"> chapter-title="Overview">
<foundry:doc-section section-id="overview" <foundry:doc-section section-id="overview"
section-title="Overview" section-title="About Foundry"
static="overview-foundry.html"/> static="overview-foundry.html"/>
<foundry:doc-section section-id="this-manual" <foundry:doc-section section-id="this-manual"
section-title="This manual" section-title="This manual"
@ -13,8 +13,8 @@
<foundry:doc-chapter chapter-id="user-manual" <foundry:doc-chapter chapter-id="user-manual"
chapter-title="User Manual"> chapter-title="User Manual">
<foundry:doc-section section-id="about-foundry" <foundry:doc-section section-id="about-foundry"
section-title="About Foundry" section-title="General structure"
static="user/about-foundry.html"/> static="user/foundry-structure.html"/>
<foundry:doc-section section-id="layout-templates" <foundry:doc-section section-id="layout-templates"
section-title="Layout templates" section-title="Layout templates"
static="user/layout-templates.html"/> static="user/layout-templates.html"/>

View File

@ -5,9 +5,18 @@
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/> <meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
</head> </head>
<body> <body>
<h1>Foundry Overview</h1> <h1>About Foundry</h1>
<main> <main>
Placeholder <p>
Foundry is a theme engine for the LibreCCM family of Content Management systems, for
example ScientificCMS and APLAWS+. Some parts of based on the Mandalay theme engine
developed by Sören Bernstein for ScientificCMS.
</p>
<p>
With Foundry the designer has full control of the HTML created from the content managed
by CCM. The templates for defining the HTML are almost plain HTML (in XML syntax) with
some additional elements which provide the data to display.
</p>
</main> </main>
</body> </body>
</html> </html>

View File

@ -5,9 +5,18 @@
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/> <meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
</head> </head>
<body> <body>
<h1>Overview</h1> <h1>About Foundry</h1>
<main>
<p> <p>
Placeholder Foundry is a theme engine for the LibreCCM family of Content Management systems, for
example ScientificCMS and APLAWS+. Some parts of based on the Mandalay theme engine
developed by Sören Bernstein for ScientificCMS.
</p> </p>
<p>
With Foundry the designer has full control of the HTML created from the content managed
by CCM. The templates for defining the HTML are almost plain HTML (in XML syntax) with
some additional elements which provide the data to display.
</p>
</main>
</body> </body>
</html> </html>

View File

@ -7,7 +7,53 @@
<body> <body>
<h1>About this manual</h1> <h1>About this manual</h1>
<main> <main>
Placeholder <p>
This manual is separated into two parts. The <a href="#user-manual">first part</a> is
for designers and administrators (called users in the context of this manual). It
describes the structure of the templates in Foundry, how CSS files are implemented
and how Frameworks like <a href="http://getbootstrap.com">Bootstrap</a>,
<a href="http://www.yaml.de">YAML</a> or <a href="http://jquery.com">jQuery</a>
can be integrated into a Foundry theme. The first part also contains a reference
part which describes all elements/tags which can be used in the templates.
If you are viewing this documentation using an URL like
<code>/themes/foundry/doc/</code> this reference is created on the fly from the
XSL files.
</p>
<p>
The <a href="#developer-manual">second part</a> is for developers which want to
extend Foundry. It describes the
structure of Foundry, how support for content types (the most common task) can be
added, how the documentation system works and which XPath functions and XSL helper
templates are available. Developers should also read the first part because the
first part includes informations about the general structure of Foundry.
</p>
<p>
In the manual the following terms a used quite often:
</p>
<dl>
<dt>context prefix</dt>
<dd>
The context in which CCM is installed in the Servlet container. If CCM is
installed in the root context the context prefix is empty.
</dd>
<dt>theme prefix</dt>
<dd>
The URL part of accessing resources inside the theme. For example for theme
called <code>foo</code> the theme prefix is
<code>/themes/published-themedir/foo</code> is published theme is used an if
CCM is installed in the root context.
</dd>
<dt>dispatcher prefix</dt>
<dd>
The URL for creating links to other CCM resources like content items. Depends
on the context in which CCM is installed and if development theme or the
published theme is used.
</dd>
<dt>data tree</dt>
<dd>The XML created by CCM containing all data of the current page.</dd>
<dt>Layout tree</dt>
<dd>The XML of layout template in processing.</dd>
</dl>
</main> </main>
</body> </body>
</html> </html>

View File

@ -1,13 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<title>About Foundry</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
</head>
<body>
<h1>About Foundry</h1>
<main>
Placeholder
</main>
</body>
</html>

View File

@ -0,0 +1,106 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html [<!ENTITY nbsp '&#160;'>
<!ENTITY shy '&#173;'>
<!ENTITY ndash '&#8211;'>]>
<html>
<head>
<title>General structure</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
</head>
<body>
<h1>General structure</h1>
<main>
<p>
There some options for using Foundry. The easiest way is to use a version/package of
LibreCCM which includes Foundry. In this case Foundry is installed in the
<code>/themes/foundry</code> folder. There should also be a second folder named
<code>/themes/foundry-base</code> which includes a basic child theme.
</p>
<p>
Foundry supports a an parent/child theme approach. This means that the logic
part of Foundry (the XSL part) is only installed in <code>/themes/foundry</code> and
is updated together with the normal upgrades of CCM. A child only contains
the templates, CSS files, static texts and configurations files for a theme. Custom
extensions are not supported yet.
</p>
<p>
A complete Foundry theme consists of the following top level folders and files:
</p>
<dl id="foundry-structure-folders">
<dt>conf</dt>
<dd>Contains configuration files for the theme</dd>
<dt>doc</dt>
<dd>Static parts of the documentation of Foundry, for example this text</dd>
<dt>fonts</dt>
<dd>Web fonts for the theme</dd>
<dt>foundry</dt>
<dd>
This folder contains the logic parts (the XSL) of Foundry. The internal
structure is described in the <a href="#developer-manual">Developer Manual</a>.
</dd>
<dt>images</dt>
<dd>Static images for the theme</dd>
<dt>libs</dt>
<dd>
Additional JavaScript libraries. jQuery and some other JavaScript libraries are
provided by CCM itself, and can be
included using special elements like the
<a href="#load-jquery"><code>load-jquery</code></a> element.
</dd>
<dt>scripts</dt>
<dd>JavaScripts needed in the theme. </dd>
<dt>styles</dt>
<dd>
The CSS styles for the theme. More information about them can be found in the
<a href="#css-files">CSS files</a> section.
</dd>
<dt>templates</dt>
<dd>
The layout templates for the theme. A detailed description can be found in the
<a href="#layout-templates">Layout templates</a> section.
</dd>
<dt>texts</dt>
<dd>Static texts for the theme</dd>
<dt>user</dt>
<dd>Custom extensions (XSL) for theme. Not supported yet.</dd>
</dl>
<p>
Foundry also supports a parent &ndash; child &ndash; grandchild structure. This is
maybe useful
when you have themes which only differ in details like logos but use the same
general structure. Most tags which are used to include resources like images,
CSS files etc. support the attribute <code>origin</code> which can have three
values:
</p>
<dl>
<dt>Not set</dt>
<dd>The resource is loaded from the current theme</dd>
<dt><code>master</code></dt>
<dd>
If the current theme is a master/parent theme the resource is loaded from the
current theme. If the current theme is a child theme the resource is loaded
from the master theme.
</dd>
<dt><code>internal</code></dt>
<dd>
The file is loaded from the <code>foundry</code>. If the theme is a child
theme is file is loaded from the Foundry master in <code>/themes/foundry</code>.
</dd>
</dl>
<p>
The recommend way for creating a team using Foundry is to create a new child theme:
</p>
<ol>
<li>To do so create a new theme using the CCM Theme director.</li>
<li>
Copy the contents of the <code>themes/foundry-base</code> folder to the folder
created by the new theme
in <code>themes/devel-themedir/</code>.
</li>
<li>
Customise the theme
</li>
</ol>
</main>
</body>
</html>

View File

@ -7,7 +7,165 @@
<body> <body>
<h1>Layout templates</h1> <h1>Layout templates</h1>
<main> <main>
Placeholder <p>
The layout templates are used by the web designer to create the HTML of the web
page. With Foundry the designer has almost complete control over the HTML. Despite
the elements which correspond to HTML 5 elements most other elements which can
be used in the templates do not create HTML. A complete list of the elements which
can be used in the layout templates can be found in the
<a href="#template-tags-reference">Template Tags Reference</a>.
</p>
<p>
Which template is used is decided by Foundry using the definitions in the
<code>conf/templates</code> file. The top layer of templates which are parsed first
are the application layouts. Which layout is used for a application is decided by
Foundry using the <code>application</code> and <code>class</code> attributes of
of <code>bebop:page</code> element in the data tree. The values of these attributes
a set in the Java code or in the JSP templates used.
</p>
<h2>Application layout templates</h2>
<h3>How Foundry determines which application layout template to use</h3>
<p>
Which template is used for which application is determined using the
<code>applications</code> section in the <code>conf/templates.xml</code> file.
The <code>applications</code> element may contain any number of
<code>application</code> elements. Each application element can have three
attributes:
</p>
<dl>
<dt><code>name</code> (mandatatory)</dt>
<dd>
The name of the application which is the value of the <code>application</code>
attribute from the data tree. To associate applications which do not set the
<code>application</code> attribute in the data tree the value <code>none</code>
can be used.
</dd>
<dt><code>class</code> (optional)</dt>
<dd>
The class of the application page shown. This is the value of the
<code>class</code> attribute from the data tree.
</dd>
<dt><code>origin</code> (optional)</dt>
<dd>
The origin of the template. In the default theme this is used to associate
the backend applications which like the content center with the
internal <code>admin-layout.xml</code> template provided by Foundry. It can also
be used to associate an application with an layout template from the parent
theme.
</dd>
</dl>
<p>
The <code>applications</code> element in the <code>conf/templates.xml</code> file
should also contain a <em>single</em> single default element which defines which
layout template should be used when no other matches.
</p>
<p>
Foundry tries to find the layout template to use as follows:
</p>
<ul>
<li>
If there an <code>application</code> element where both <code>name</code> and
<code>class</code> match the values from the data tree this template is used.
</li>
<li>
Otherwise Foundry checks if there is an <code>application</code> element
without a <code>class</code> attribute where value of the <code>name</code>
attribute matches the value from the data tree.
</li>
<li>
If this also fails and there is a <code>default</code> element the template
from the <code>default</code> element is used.
</li>
<li>
If there is no <code>default</code> element the internal default layout template
is used.
</li>
</ul>
<h3>The structure of a application layout template</h3>
<p>
An layout template is a normal XML file. The root element is the
<a href="#page-layout"><code>page-layout</code></a> element.
The first child should be a <a href="#head">head</a> element. The <code>head</code>
element is equivalent of the HTML head element. Inside the <code>head</code>
element the title of (the string shown as title of the browser window) can
be determined using the <a href="#title"><code>title</code></a> element. Also
the <code>head</code> is the place to load the CSS and JavaScript files and where
to put meta informations.
</p>
<p>
After the <code>head</code> there should be a <a href="#body"><code>body</code></a>
element. Inside the <code>body</code> element the HTML structure is defined.
At some point you may want to insert the content of a content item or of a Portlet.
This is done using elements like <a href="#content-item"><code>content-item</code></a> element
or
<a href="#portal-grid-workspace-column-portlets"><code>portal-grid-workspace-column-portlets</code></a>.
The layout of the individual content item or Portlet is defined in separate
templates.
</p>
<h2>Content Item layout templates</h2>
<p>
The content layout templates which are found in the
<code>templates/content-items</code> folder are used to create the HTML for
content items in the list, link and detail views. Which template is used for which
content item is determined using the <code>content-items</code> section in the
<code>conf/templates.xml</code> file.
</p>
<h3>Selecting the Content Item layout template to use</h3>
<p>
The <code>content-items</code> element in the <code>conf/templates.xml</code> file
has three sub elements: <code>detail</code>, <code>link</code> and
<code>list</code>. The <code>content-item</code> elements in these elements are
determining which template is used for which content type. There are several
attributes for selecting the template. For a description of the available attributes
please refer to the documentation of the
<a href="#content-item"><code>content-item</code></a> tag.
</p>
<h3>Structure of a Content Item layout template</h3>
<p>
Like the application layout templates a content item layout template is a XML file.
The root element is the <code>content-item-layout</code> element. Inside this
element all HTML producing elements can be used. For some content types there are
special elements for outputting special properties. For example the for news item
there is an elements <a href="#news-date"><code>news-date</code></a> which outputs
the date of a news. This element also provides an interface for designer to
customise the format in which the date is shown. There is is also an general tag
<a href="#show-property"><code>show-property</code></a> which can be used to
create a basic template for an unsupported content type.
</p>
<h2>Portlet templates</h2>
<p>
For Portlets the system is similar to the system for content items. Which template
is used for a specific Portlet is determined using the child elements of the
<code>portlets</code> element in the <code>conf/templates.xml</code> file. The
<code>portlet</code> elements which contain the path of the template to use can have
two child elements:
</p>
<dl>
<dt>class</dt>
<dd>
The class name of the Portlet.
</dd>
<dt>workspace</dt>
<dd>
The name of the workspace in which the Portlet is shown.
</dd>
</dl>
<p>
Foundry first tries to find a match for both <code>class</code> and
<code>workspace</code>. If there is no matching <code>portlet</code> element in
<code>conf/templates.xml</code> Foundry tries to find a match for the class name
only. If this also fails it used the templates defined in
<code>portlets/default</code> in the <code>conf/templates.xml</code> file.
</p>
<p>
The root element of a Portlet layout template is the <code>portlet-layout</code>
element. Inside this element all HTML elements can be used. For each Portlet type
there will be least on specific element which outputs the content of the Portlet.
</p>
</main> </main>
</body> </body>
</html> </html>

View File

@ -153,6 +153,10 @@ body {
font-size: 1em; font-size: 1em;
} }
.nav-hide {
display: none;
}
main { main {
/*margin-top: 3em; /*margin-top: 3em;
margin-bottom: 3em;*/ margin-bottom: 3em;*/
@ -191,6 +195,7 @@ footer .border-wrapper {
border-top: 1px solid #000; border-top: 1px solid #000;
} }
@media screen {
nav { nav {
position: fixed; position: fixed;
/*right: 2em;*/ /*right: 2em;*/
@ -199,6 +204,7 @@ nav {
margin-left: 22em; margin-left: 22em;
width: 16em; width: 16em;
} }
}
pre, code { pre, code {
font-family: liberation_mono; font-family: liberation_mono;
@ -241,4 +247,29 @@ main article section section section section h1 {
main article section section section section.template-tag h1 { main article section section section section.template-tag h1 {
font-family: liberation_mono; font-family: liberation_mono;
font-size: 1.2em;
}
main article section section section section.template-tag h2{
font-size: 1.2em;
font-weight: bold;
color: #444;
}
dl#foundry-structure-folders dt {
font-family: liberation_mono;
float: left;
width: 8em;
margin: 0.2em 0;
}
dl#foundry-structure-folders dd {
margin: 0.2em 0 0.2em 8.5em;
}
dl#foundry-structure-folders dd:after {
content: ".";
display: block;
visibility: hidden;
clear: both;
} }

View File

@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE stylesheet [<!ENTITY nbsp '&#160;'> <!DOCTYPE stylesheet [<!ENTITY nbsp '&#160;'>
<!ENTITY shy '&#173;'>]> <!ENTITY shy '&#173;'>
<!ENTITY ndash '&#8211;'>]>
<!-- <!--
Copyright 2014 Jens Pelzetter for the LibreCCM Foundation Copyright 2014 Jens Pelzetter for the LibreCCM Foundation
@ -28,6 +29,7 @@
xmlns:foundry="http://foundry.libreccm.org" xmlns:foundry="http://foundry.libreccm.org"
xmlns:nav="http://ccm.redhat.com/navigation" xmlns:nav="http://ccm.redhat.com/navigation"
xmlns:ui="http://www.arsdigita.com/ui/1.0" xmlns:ui="http://www.arsdigita.com/ui/1.0"
xmlns="http://www.w3.org/1999/xhtml"
exclude-result-prefixes="xsl xs bebop cms foundry nav ui" exclude-result-prefixes="xsl xs bebop cms foundry nav ui"
version="2.0"> version="2.0">

View File

@ -90,7 +90,7 @@
</dt> </dt>
<dd> <dd>
The template is only used for the content item if the item is viewed as The template is only used for the content item if the item is viewed as
item of the category. The category is set as a path contains the names item of the category. The category is set as a path containing the names
the categories. the categories.
</dd> </dd>
<dt> <dt>

View File

@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE stylesheet [<!ENTITY nbsp '&#160;'> <!DOCTYPE stylesheet [<!ENTITY nbsp '&#160;'>
<!ENTITY shy '&#173;'>]> <!ENTITY shy '&#173;'>
<!ENTITY ndash '&#8211;'>]>
<!-- <!--
Copyright 2014 Jens Pelzetter for the LibreCCM Foundation Copyright 2014 Jens Pelzetter for the LibreCCM Foundation
@ -27,6 +28,7 @@
xmlns:foundry="http://foundry.libreccm.org" xmlns:foundry="http://foundry.libreccm.org"
xmlns:nav="http://ccm.redhat.com/navigation" xmlns:nav="http://ccm.redhat.com/navigation"
xmlns:ui="http://www.arsdigita.com/ui/1.0" xmlns:ui="http://www.arsdigita.com/ui/1.0"
xmlns="http://www.w3.org/1999/xhtml"
exclude-result-prefixes="xsl xs bebop cms foundry nav ui" exclude-result-prefixes="xsl xs bebop cms foundry nav ui"
version="2.0"> version="2.0">
@ -106,7 +108,7 @@
<xsl:param name="chapter-id" tunnel="yes"/> <xsl:param name="chapter-id" tunnel="yes"/>
<xsl:apply-templates> <xsl:apply-templates>
<xsl:with-param name="article-id" select="$chapter-id"/> <xsl:with-param name="id" select="$chapter-id"/>
</xsl:apply-templates> </xsl:apply-templates>
</xsl:template> </xsl:template>
@ -135,7 +137,7 @@
<xsl:param name="section-id" tunnel="yes"/> <xsl:param name="section-id" tunnel="yes"/>
<xsl:apply-templates> <xsl:apply-templates>
<xsl:with-param name="section-id" select="$section-id"/> <xsl:with-param name="id" select="$section-id"/>
</xsl:apply-templates> </xsl:apply-templates>
</xsl:template> </xsl:template>
@ -240,7 +242,7 @@
<xsl:param name="function-name" tunnel="yes"/> <xsl:param name="function-name" tunnel="yes"/>
<xsl:apply-templates> <xsl:apply-templates>
<xsl:with-param name="section-id" select="$function-name"/> <xsl:with-param name="id" select="$function-name"/>
</xsl:apply-templates> </xsl:apply-templates>
</xsl:template> </xsl:template>
@ -354,7 +356,7 @@
<xsl:param name="matches" tunnel="yes"/> <xsl:param name="matches" tunnel="yes"/>
<xsl:apply-templates> <xsl:apply-templates>
<xsl:with-param name="section-id" select="$matches"/> <xsl:with-param name="id" select="$matches"/>
</xsl:apply-templates> </xsl:apply-templates>
</xsl:template> </xsl:template>
@ -422,6 +424,14 @@
</xsl:apply-templates> </xsl:apply-templates>
</xsl:template> </xsl:template>
<xsl:template match="doc-envvar-layout">
<xsl:param name="name" tunnel="yes"/>
<xsl:apply-templates>
<xsl:with-param name="id" select="$name"/>
</xsl:apply-templates>
</xsl:template>
<xsl:template match="doc-env-var-name"> <xsl:template match="doc-env-var-name">
<xsl:param name="name" tunnel="yes"/> <xsl:param name="name" tunnel="yes"/>

View File

@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE stylesheet [<!ENTITY nbsp '&#160;'> <!DOCTYPE stylesheet [<!ENTITY nbsp '&#160;'>
<!ENTITY shy '&#173;'>]> <!ENTITY shy '&#173;'>
<!ENTITY ndash '&#8211;'>]>
<!-- <!--
Copyright 2014 Jens Pelzetter for the LibreCCM Foundation Copyright 2014 Jens Pelzetter for the LibreCCM Foundation

View File

@ -218,19 +218,62 @@
</xsl:template> </xsl:template>
<foundry:doc section="user" type="template-tag">
<foundry:doc-desc>
<p>
Loads the <a href="http://jquery.com">jQuery</a> JavaScript library provided by CCM.
</p>
</foundry:doc-desc>
</foundry:doc>
<xsl:template match="load-jquery"> <xsl:template match="load-jquery">
<script type="text/javascript" src="{$context-prefix}/assets/jquery.js"/> <script type="text/javascript" src="{$context-prefix}/assets/jquery.js"/>
</xsl:template> </xsl:template>
<foundry:doc section="user" type="template-tag">
<foundry:doc-desc>
<p>
Loads the <a href="http://jqueryui.com">jQuery UI</a> JavaScript library provided
by CCM.
</p>
</foundry:doc-desc>
</foundry:doc>
<xsl:template match="load-jquery-ui"> <xsl:template match="load-jquery-ui">
<script type="text/javascript" src="{$context-prefix}/assets/jquery-ui.min.js"/> <script type="text/javascript" src="{$context-prefix}/assets/jquery-ui.min.js"/>
</xsl:template> </xsl:template>
<foundry:doc section="user" type="template-tag">
<foundry:doc-desc>
<p>
Loads the <a href="http://www.mathjax.org/">MathJAX JavaScript</a> library which can
render mathematical formulas written in MathML or LaTeX syntax.
</p>
</foundry:doc-desc>
</foundry:doc>
<xsl:template match="load-mathjax"> <xsl:template match="load-mathjax">
<script type="text/javascript" <script type="text/javascript"
src="{$context-prefix}/assets/mathjax/MathJax.js?config=TeX-MML-AM_HTMLorMML"/> src="{$context-prefix}/assets/mathjax/MathJax.js?config=TeX-MML-AM_HTMLorMML"/>
</xsl:template> </xsl:template>
<foundry:doc section="user" type="template-tag">
<foundry:doc-desc>
<p>
Loads the <a href="https://github.com/aFarkas/html5shiv">html5shiv</a> JavaScript
library which fixes a bug of old Internet Explorers
(up to version 8) with elements unknown by the Internet Explorer. You need this
library if you want to use HTML 5 elements like <code>article</code> or
<code>nav</code> in your templates. All other browser thread unknown elements
like <code>div</code> or <code>span</code>. The Internet Explorer to version 8
however adds a closing elements to the DOM tree directly after the unknown opening
element, effectively removing the element from the DOM. The <em>html5shiv</em>
library fixes the DOM tree using JavaScript.
</p>
<p>
This tag adds a
<a href="http://en.wikipedia.org/wiki/Conditional_comment">conditional comment</a>
to load the html5shiv library only for old Internet Explorers
</p>
</foundry:doc-desc>
</foundry:doc>
<xsl:template match="load-html5shiv"> <xsl:template match="load-html5shiv">
<xsl:value-of select="concat(' <xsl:value-of select="concat('
&lt;!-- &lt;!--

View File

@ -176,10 +176,42 @@
<foundry:doc section="devel" type="function"> <foundry:doc section="devel" type="function">
<foundry:doc-desc> <foundry:doc-desc>
<p> <p>
Variant of <code>gen-path</code> with an additional <code>internal</code> Variant of <code>gen-path</code> with an additional <code>origin</code>
parameter. If set to <code>true</code> the file is loaded from the parameter. This parameter can have three values:
If set to <code>true</code> the file is loaded from the
<code>foundry</code> directory. <code>foundry</code> directory.
</p> </p>
<dl>
<dt>empty string (<code>''</code>)</dt>
<dd>
The path points to a resource in the theme directory. The return value is the
concatenation of the theme-prefix, a slash and the path provided as first
parameter. In XPath Syntax: <code>concat($theme-prefix, '/', $path</code>.
</dd>
<dt>master</dt>
<dd>
If the theme mode (which is set in <code>conf/global.xml</code>) is set to
<code>master</code> the result is the same as for the empty string. If the
the theme mode is set to <code>child</code> the generated path points to
the parent/master theme. More exactly the result is the concatenation of the
context-prefix environment variable, the string <code>/themes/</code>, the
name of the master theme (set in <code>conf/global.xml</code>,
usally <code>foundry</code>), a slash the the path provided as first parameter.
Or in XPath syntax:
<code>concat($content-prefix, '/themes/', $master-theme, '/', $path.)</code>.
</dd>
<dt>internal</dt>
<dd>
The path points to an internal resource which is provided by Foundry. If the
theme mode is <code>master</code> the generated path is the concatenation of
the theme prefix, the string <code>/foundry/</code> and the path provided as
first parameter (XPath: <code>concat($theme-prefix, '/foundry/', $path)</code>.
If the theme mode is <code>child</code> the generated path
is the concatenation of the context prefix, the string
<code>/themes/foundry/foundry/</code> and the path provided as first parameter
(XPath: <code>concat($context-prefix, '/themes/foundry/foundry/', $path)</code>).
</dd>
</dl>
</foundry:doc-desc> </foundry:doc-desc>
</foundry:doc> </foundry:doc>
<xsl:function name="foundry:gen-path" as="xs:string"> <xsl:function name="foundry:gen-path" as="xs:string">

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<doc-template-tag-layout> <doc-envvar-layout>
<section class="template-tag"> <section class="template-tag">
<h1> <h1>
<doc-env-var-name/> <doc-env-var-name/>
@ -25,4 +25,4 @@
</doc-see-also-link-list> </doc-see-also-link-list>
</section> </section>
</doc-template-tag-layout> </doc-envvar-layout>