source: main/waeup.kofa/branches/uli-diazo-themed/layout/rules.xml @ 10968

Last change on this file since 10968 was 10950, checked in by uli, 11 years ago

Rename base.xml to rules.xml.

File size: 4.3 KB
Line 
1<?xml version="1.0" encoding="UTF-8"?>
2<rules
3    xmlns="http://namespaces.plone.org/diazo"
4    xmlns:css="http://namespaces.plone.org/diazo/css"
5    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
6    xmlns:xi="http://www.w3.org/2001/XInclude">
7
8  <!-- Cases where we do not want themes... -->
9  <notheme if-path="/++grokui++" />  <!-- do not theme GrokUI -->
10  <notheme if-path="/_debug" /><!-- output by debugger -->
11  <notheme css:if-content="div#error-area" />
12
13  <!-- use error page if there is a <table class="layout">
14       tag in content. This tag is rendered in Zope 3 errors. -->
15  <rules css:if-content="table#layout">
16    <theme href="error-zope.html" />
17    <replace css:theme-children="#kofa-error-message"
18             css:content-children="h3" />
19  </rules>
20  <!-- use error page if there is no <div> tag in content.
21       This happens if something in the application went wrong. -->
22  <rules css:if-not-content="div">
23    <theme href="error-zope.html" />
24    <replace css:theme-children="#kofa-error-message"
25             css:content-children="body" />
26  </rules>
27
28  <!-- regular rules -->
29  <rules css:if-content="body.kofa-body">
30
31    <theme href="theme.html" />
32
33    <!-- head elements -->
34    <replace css:theme="html head title"
35             css:content="html head title" />
36
37    <!-- brand (upper left) -->
38    <copy attributes="href" css:theme="a.kofa-brand-link"
39          css:content="a.kofa-brand-link" />
40    <replace css:theme-children="a.kofa-brand-link"
41             css:content-children="a.kofa-brand-link" />
42
43    <!-- left top navigation -->
44    <replace css:theme-children="ul.kofa-navbar-left"
45             css:content-children="ul.kofa-navbar-left" />
46
47    <!-- right side top navigation -->
48    <replace css:theme-children="ul.kofa-navbar-right"
49             css:content-children="ul.kofa-navbar-right" />
50
51    <!-- breadcrumbs -->
52    <replace css:theme-children="ol.kofa-breadcrumbs"
53             css:content="ul.breadcrumb li" />
54    <drop css:theme="div.kofa-breadcrumbs-box"
55          css:if-not-content="ul.breadcrumb" />
56
57    <!-- sidebar -->
58
59    <drop css:theme="div.kofa-sidebar"
60          css:if-not-content="div.sidebar" />
61    <replace css:theme-children=".kofa-sidebar-title"
62             css:content-children="div.sidebar h5" />
63    <replace css:theme-children=".kofa-sidebar-body"
64             css:content-children="div.sidebar ul" />
65
66    <!-- content -->
67
68    <!-- drop one of the both content areas, depending on sidebar -->
69
70    <drop css:theme="div.kofa-content-narrow"
71          css:if-not-content="div.sidebar" />
72    <drop css:theme="div.kofa-content-wide"
73          css:if-content="div.sidebar" />
74    <replace css:theme-children="div.kofa-content"
75             css:content-children="div.kofa-content" />
76
77
78    <!-- scripts -->
79    <drop css:theme="script.kofa-script-tooltip"
80          css:if-not-content="[data-toggle=tooltip]" />
81
82<!--
83    <after css:theme-children="html head"
84           css:content="html head meta" />
85-->
86<!--
87    <after css:theme-children="html head"
88           css:content="html head base" />
89-->
90
91    <!-- top navigation -->
92    <!-- left top navigation -->
93<!--
94    <replace css:theme-children="ul.kofa-navbar-left"
95             css:content-children="ul.kofa-navbar-left" />
96-->
97
98    <!-- the language selector
99
100      quite tricky. We insert a <li> element at end of
101      ul.kofa-navbar-left. This <li> has a header element
102      (the 'Language' button) and the a number of <li> elements
103      representing the supported languages.
104      We change the input content of format
105
106         <a href="foo" title="Lang">Abbrev</a>
107
108      to
109
110         <a href="foo">Lang</a>
111
112      creating new nodes (<xsl:element>) with attributes copied over.
113    -->
114    <after css:theme-children="ul.kofa-navbar-left">
115      <li class="dropdown kofa-langselect">
116        <a href="#" class="dropdown-toggle"
117           data-toggle="dropdown">Language <b class="caret"></b></a>
118        <ul class="dropdown-menu">
119          <xsl:for-each css:select=" .language a">
120            <li class="kofa-language">
121              <xsl:element name="a">
122                <xsl:attribute name="href">
123                  <xsl:value-of select="@href" />
124                </xsl:attribute>
125                <xsl:value-of select="@title" />
126              </xsl:element>
127            </li>
128          </xsl:for-each>
129        </ul>
130      </li>
131    </after>
132
133
134
135
136  </rules>
137
138</rules>
Note: See TracBrowser for help on using the repository browser.