Inheritence for Foundry layout templates
git-svn-id: https://svn.libreccm.org/ccm/trunk@3282 8810af33-2d31-482b-a856-94f89814c4dfmaster
parent
1e3cb64455
commit
90a0dadbf8
|
|
@ -8,7 +8,8 @@
|
||||||
<application name="login" origin="internal">admin-layout.xml</application>
|
<application name="login" origin="internal">admin-layout.xml</application>
|
||||||
<application name="navigation" class="portalPage">portal-workspace.xml</application>
|
<application name="navigation" class="portalPage">portal-workspace.xml</application>
|
||||||
<application name="navigation" class="portalGridPage">portal-workspace-grid.xml</application>
|
<application name="navigation" class="portalGridPage">portal-workspace-grid.xml</application>
|
||||||
<application name="navigation" class="simplePage">nav-default.xml</application>
|
<!--<application name="navigation" class="simplePage">nav-default.xml</application>-->
|
||||||
|
<application name="navigation" class="simplePage">nav-layout.xml</application>
|
||||||
<application name="none" class="cms-admin" origin="internal">admin-layout.xml</application>
|
<application name="none" class="cms-admin" origin="internal">admin-layout.xml</application>
|
||||||
<application name="portal">portal-workspace.xml</application>
|
<application name="portal">portal-workspace.xml</application>
|
||||||
<default>default-layout.xml</default>
|
<default>default-layout.xml</default>
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,21 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<page-layout>
|
||||||
|
<head>
|
||||||
|
<title>
|
||||||
|
<separator>: </separator>
|
||||||
|
<show-text>layout/page/head/title</show-text>
|
||||||
|
<show-page-title/>
|
||||||
|
</title>
|
||||||
|
<load-css-files/>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<include file="fragments/header-with-nav.xml"/>
|
||||||
|
<main class="content-width">
|
||||||
|
<include file="fragments/second-level-nav.xml"/>
|
||||||
|
|
||||||
|
<insert-block name="content"/>
|
||||||
|
|
||||||
|
</main>
|
||||||
|
<include file="fragments/footer.xml"/>
|
||||||
|
</body>
|
||||||
|
</page-layout>
|
||||||
|
|
@ -0,0 +1,45 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<page-layout extends="master-layout.xml">
|
||||||
|
|
||||||
|
<block name="content">
|
||||||
|
<div>
|
||||||
|
<h1>
|
||||||
|
<show-page-title/>
|
||||||
|
</h1>
|
||||||
|
<content-item mode="detail"/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<object-list id="itemList">
|
||||||
|
<ul>
|
||||||
|
<object-list-item>
|
||||||
|
<li>
|
||||||
|
<content-item mode="list"/>
|
||||||
|
</li>
|
||||||
|
</object-list-item>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
</object-list>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<nav-quicklinks>
|
||||||
|
<h2>
|
||||||
|
<show-text>page/layout/nav-quicklinks</show-text>
|
||||||
|
</h2>
|
||||||
|
<dl>
|
||||||
|
<nav-quicklink>
|
||||||
|
<dt>
|
||||||
|
<a>
|
||||||
|
<nav-quicklink-title/>
|
||||||
|
</a>
|
||||||
|
</dt>
|
||||||
|
<dd>
|
||||||
|
<nav-quicklink-description/>
|
||||||
|
</dd>
|
||||||
|
</nav-quicklink>
|
||||||
|
</dl>
|
||||||
|
</nav-quicklinks>
|
||||||
|
</block>
|
||||||
|
|
||||||
|
|
||||||
|
</page-layout>
|
||||||
|
|
@ -50,7 +50,7 @@
|
||||||
</p>
|
</p>
|
||||||
</foundry:doc-desc>
|
</foundry:doc-desc>
|
||||||
</foundry:doc>
|
</foundry:doc>
|
||||||
<xsl:template match="page-layout">
|
<xsl:template match="page-layout[not(./@extends)]">
|
||||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
<xsl:attribute name="lang">
|
<xsl:attribute name="lang">
|
||||||
<xsl:value-of select="$language"/>
|
<xsl:value-of select="$language"/>
|
||||||
|
|
@ -79,6 +79,48 @@
|
||||||
</html>
|
</html>
|
||||||
</xsl:template>
|
</xsl:template>
|
||||||
|
|
||||||
|
<foundry:doc section="user" type="template-tag">
|
||||||
|
<foundry:doc-desc>
|
||||||
|
<p>
|
||||||
|
Root element of an extending template. The <code>extends</code>
|
||||||
|
attribute is required and points to the template which is
|
||||||
|
extended by the layout. Only the <code>block</code> elements
|
||||||
|
in the layout are processed. The master layout must contain
|
||||||
|
matching <code>insert-block</code> elements.
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
Technically the master template is processed first and the
|
||||||
|
extending layout is passed as parameter. The master layout
|
||||||
|
</p>
|
||||||
|
</foundry:doc-desc>
|
||||||
|
<foundry:doc-see-also>#block</foundry:doc-see-also>
|
||||||
|
<foundry:doc-see-also>#insert-block</foundry:doc-see-also>
|
||||||
|
</foundry:doc>
|
||||||
|
<xsl:template match="page-layout[./@extends]">
|
||||||
|
<xsl:apply-templates select="document(./@extends)">
|
||||||
|
<xsl:with-param name="extending-layout"
|
||||||
|
tunnel="yes"
|
||||||
|
select=".">
|
||||||
|
</xsl:with-param>
|
||||||
|
</xsl:apply-templates>
|
||||||
|
</xsl:template>
|
||||||
|
|
||||||
|
<foundry:doc type="template-tag" section="user">
|
||||||
|
<foundry:doc-desc>
|
||||||
|
<p>
|
||||||
|
The element is used in a master layout to insert a block
|
||||||
|
from an extending template.
|
||||||
|
</p>
|
||||||
|
</foundry:doc-desc>
|
||||||
|
</foundry:doc>
|
||||||
|
<xsl:template match="insert-block">
|
||||||
|
<xsl:param name="extending-layout" tunnel="yes"/>
|
||||||
|
|
||||||
|
<xsl:variable name="block-name" select="./@name"/>
|
||||||
|
|
||||||
|
<xsl:apply-templates select="$extending-layout/block[./@name = $block-name]"/>
|
||||||
|
</xsl:template>
|
||||||
|
|
||||||
<foundry:doc section="user" type="template-tag">
|
<foundry:doc section="user" type="template-tag">
|
||||||
<foundry:doc-desc>
|
<foundry:doc-desc>
|
||||||
<p>
|
<p>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue