diff --git a/ccm-sci-bundle/web/themes/foundry/doc/foundry-documentation.xml b/ccm-sci-bundle/web/themes/foundry/doc/foundry-documentation.xml index 8342a5336..a658f9a56 100644 --- a/ccm-sci-bundle/web/themes/foundry/doc/foundry-documentation.xml +++ b/ccm-sci-bundle/web/themes/foundry/doc/foundry-documentation.xml @@ -3,7 +3,7 @@ + section-title="General structure" + static="user/foundry-structure.html"/> diff --git a/ccm-sci-bundle/web/themes/foundry/doc/static-texts/overview-foundry.html b/ccm-sci-bundle/web/themes/foundry/doc/static-texts/overview-foundry.html index 708254c0f..3e7d2f590 100644 --- a/ccm-sci-bundle/web/themes/foundry/doc/static-texts/overview-foundry.html +++ b/ccm-sci-bundle/web/themes/foundry/doc/static-texts/overview-foundry.html @@ -5,9 +5,18 @@ -

Foundry Overview

+

About Foundry

- 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. +

+

+ 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. +

\ No newline at end of file diff --git a/ccm-sci-bundle/web/themes/foundry/doc/static-texts/overview.html b/ccm-sci-bundle/web/themes/foundry/doc/static-texts/overview.html index ece024a94..7746d3ffc 100644 --- a/ccm-sci-bundle/web/themes/foundry/doc/static-texts/overview.html +++ b/ccm-sci-bundle/web/themes/foundry/doc/static-texts/overview.html @@ -5,9 +5,18 @@ -

Overview

-

- Placeholder -

+

About Foundry

+
+

+ 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. +

+

+ 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. +

+
\ No newline at end of file diff --git a/ccm-sci-bundle/web/themes/foundry/doc/static-texts/this-manual.html b/ccm-sci-bundle/web/themes/foundry/doc/static-texts/this-manual.html index 3007e243e..70f21ca9f 100644 --- a/ccm-sci-bundle/web/themes/foundry/doc/static-texts/this-manual.html +++ b/ccm-sci-bundle/web/themes/foundry/doc/static-texts/this-manual.html @@ -7,7 +7,53 @@

About this manual

- Placeholder +

+ This manual is separated into two parts. The first part 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 Bootstrap, + YAML or jQuery + 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 + /themes/foundry/doc/ this reference is created on the fly from the + XSL files. +

+

+ The second part 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. +

+

+ In the manual the following terms a used quite often: +

+
+
context prefix
+
+ The context in which CCM is installed in the Servlet container. If CCM is + installed in the root context the context prefix is empty. +
+
theme prefix
+
+ The URL part of accessing resources inside the theme. For example for theme + called foo the theme prefix is + /themes/published-themedir/foo is published theme is used an if + CCM is installed in the root context. +
+
dispatcher prefix
+
+ 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. +
+
data tree
+
The XML created by CCM containing all data of the current page.
+
Layout tree
+
The XML of layout template in processing.
+
\ No newline at end of file diff --git a/ccm-sci-bundle/web/themes/foundry/doc/static-texts/user/about-foundry.html b/ccm-sci-bundle/web/themes/foundry/doc/static-texts/user/about-foundry.html deleted file mode 100644 index 96569dec0..000000000 --- a/ccm-sci-bundle/web/themes/foundry/doc/static-texts/user/about-foundry.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - About Foundry - - - -

About Foundry

-
- Placeholder -
- - \ No newline at end of file diff --git a/ccm-sci-bundle/web/themes/foundry/doc/static-texts/user/foundry-structure.html b/ccm-sci-bundle/web/themes/foundry/doc/static-texts/user/foundry-structure.html new file mode 100644 index 000000000..716a77d64 --- /dev/null +++ b/ccm-sci-bundle/web/themes/foundry/doc/static-texts/user/foundry-structure.html @@ -0,0 +1,106 @@ + + + + ]> + + + General structure + + + +

General structure

+
+

+ 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 + /themes/foundry folder. There should also be a second folder named + /themes/foundry-base which includes a basic child theme. +

+

+ Foundry supports a an parent/child theme approach. This means that the logic + part of Foundry (the XSL part) is only installed in /themes/foundry 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. +

+

+ A complete Foundry theme consists of the following top level folders and files: +

+
+
conf
+
Contains configuration files for the theme
+
doc
+
Static parts of the documentation of Foundry, for example this text
+
fonts
+
Web fonts for the theme
+
foundry
+
+ This folder contains the logic parts (the XSL) of Foundry. The internal + structure is described in the Developer Manual. +
+
images
+
Static images for the theme
+
libs
+
+ Additional JavaScript libraries. jQuery and some other JavaScript libraries are + provided by CCM itself, and can be + included using special elements like the + load-jquery element. +
+
scripts
+
JavaScripts needed in the theme.
+
styles
+
+ The CSS styles for the theme. More information about them can be found in the + CSS files section. +
+
templates
+
+ The layout templates for the theme. A detailed description can be found in the + Layout templates section. +
+
texts
+
Static texts for the theme
+
user
+
Custom extensions (XSL) for theme. Not supported yet.
+
+

+ Foundry also supports a parent – child – 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 origin which can have three + values: +

+
+
Not set
+
The resource is loaded from the current theme
+
master
+
+ 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. +
+
internal
+
+ The file is loaded from the foundry. If the theme is a child + theme is file is loaded from the Foundry master in /themes/foundry. +
+
+

+ The recommend way for creating a team using Foundry is to create a new child theme: +

+
    +
  1. To do so create a new theme using the CCM Theme director.
  2. +
  3. + Copy the contents of the themes/foundry-base folder to the folder + created by the new theme + in themes/devel-themedir/. +
  4. +
  5. + Customise the theme +
  6. +
+
+ + \ No newline at end of file diff --git a/ccm-sci-bundle/web/themes/foundry/doc/static-texts/user/layout-templates.html b/ccm-sci-bundle/web/themes/foundry/doc/static-texts/user/layout-templates.html index 26d75a903..d548163c9 100644 --- a/ccm-sci-bundle/web/themes/foundry/doc/static-texts/user/layout-templates.html +++ b/ccm-sci-bundle/web/themes/foundry/doc/static-texts/user/layout-templates.html @@ -7,7 +7,165 @@

Layout templates

- Placeholder +

+ 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 + Template Tags Reference. +

+

+ Which template is used is decided by Foundry using the definitions in the + conf/templates 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 application and class attributes of + of bebop:page element in the data tree. The values of these attributes + a set in the Java code or in the JSP templates used. + +

+ +

Application layout templates

+

How Foundry determines which application layout template to use

+

+ Which template is used for which application is determined using the + applications section in the conf/templates.xml file. + The applications element may contain any number of + application elements. Each application element can have three + attributes: +

+
+
name (mandatatory)
+
+ The name of the application which is the value of the application + attribute from the data tree. To associate applications which do not set the + application attribute in the data tree the value none + can be used. +
+
class (optional)
+
+ The class of the application page shown. This is the value of the + class attribute from the data tree. +
+
origin (optional)
+
+ 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 admin-layout.xml template provided by Foundry. It can also + be used to associate an application with an layout template from the parent + theme. +
+
+

+ The applications element in the conf/templates.xml file + should also contain a single single default element which defines which + layout template should be used when no other matches. +

+

+ Foundry tries to find the layout template to use as follows: +

+
    +
  • + If there an application element where both name and + class match the values from the data tree this template is used. +
  • +
  • + Otherwise Foundry checks if there is an application element + without a class attribute where value of the name + attribute matches the value from the data tree. +
  • +
  • + If this also fails and there is a default element the template + from the default element is used. +
  • +
  • + If there is no default element the internal default layout template + is used. +
  • +
+

The structure of a application layout template

+

+ An layout template is a normal XML file. The root element is the + page-layout element. + The first child should be a head element. The head + element is equivalent of the HTML head element. Inside the head + element the title of (the string shown as title of the browser window) can + be determined using the title element. Also + the head is the place to load the CSS and JavaScript files and where + to put meta informations. +

+

+ After the head there should be a body + element. Inside the body 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 content-item element + or + portal-grid-workspace-column-portlets. + The layout of the individual content item or Portlet is defined in separate + templates. +

+ +

Content Item layout templates

+

+ The content layout templates which are found in the + templates/content-items 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 content-items section in the + conf/templates.xml file. +

+

Selecting the Content Item layout template to use

+

+ The content-items element in the conf/templates.xml file + has three sub elements: detail, link and + list. The content-item 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 + content-item tag. +

+

Structure of a Content Item layout template

+

+ Like the application layout templates a content item layout template is a XML file. + The root element is the content-item-layout 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 news-date 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 + show-property which can be used to + create a basic template for an unsupported content type. +

+ +

Portlet templates

+

+ 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 + portlets element in the conf/templates.xml file. The + portlet elements which contain the path of the template to use can have + two child elements: +

+
+
class
+
+ The class name of the Portlet. +
+
workspace
+
+ The name of the workspace in which the Portlet is shown. +
+
+

+ Foundry first tries to find a match for both class and + workspace. If there is no matching portlet element in + conf/templates.xml Foundry tries to find a match for the class name + only. If this also fails it used the templates defined in + portlets/default in the conf/templates.xml file. +

+

+ The root element of a Portlet layout template is the portlet-layout + 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. +

\ No newline at end of file diff --git a/ccm-sci-bundle/web/themes/foundry/doc/styles/foundry-doc.css b/ccm-sci-bundle/web/themes/foundry/doc/styles/foundry-doc.css index 91c84a6e4..53e8d9a4d 100644 --- a/ccm-sci-bundle/web/themes/foundry/doc/styles/foundry-doc.css +++ b/ccm-sci-bundle/web/themes/foundry/doc/styles/foundry-doc.css @@ -54,9 +54,9 @@ font-family: 'liberation_serif'; src: url('../fonts/LiberationSerif-Bold-webfont.eot'); src: url('../fonts/LiberationSerif-Bold-webfont.eot?#iefix') format('embedded-opentype'), - url('../fonts/LiberationSerif-Bold-webfont.woff') format('woff'), - url('../fonts/LiberationSerif-Bold-webfont.ttf') format('truetype'), - url('../fonts/LiberationSerif-Bold-webfont.svg#liberation_serifbold') format('svg'); + url('../fonts/LiberationSerif-Bold-webfont.woff') format('woff'), + url('../fonts/LiberationSerif-Bold-webfont.ttf') format('truetype'), + url('../fonts/LiberationSerif-Bold-webfont.svg#liberation_serifbold') format('svg'); font-weight: bold; font-style: normal; } @@ -65,9 +65,9 @@ font-family: 'liberation_serif'; src: url('../fonts/LiberationSerif-BoldItalic-webfont.eot'); src: url('../fonts/LiberationSerif-BoldItalic-webfont.eot?#iefix') format('embedded-opentype'), - url('../fonts/LiberationSerif-BoldItalic-webfont.woff') format('woff'), - url('../fonts/LiberationSerif-BoldItalic-webfont.ttf') format('truetype'), - url('../fonts/LiberationSerif-BoldItalic-webfont.svg#liberation_serifbold_italic') format('svg'); + url('../fonts/LiberationSerif-BoldItalic-webfont.woff') format('woff'), + url('../fonts/LiberationSerif-BoldItalic-webfont.ttf') format('truetype'), + url('../fonts/LiberationSerif-BoldItalic-webfont.svg#liberation_serifbold_italic') format('svg'); font-weight: bold; font-style: italic; @@ -77,9 +77,9 @@ font-family: 'liberation_serif'; src: url('../fonts/LiberationSerif-Italic-webfont.eot'); src: url('../fonts/LiberationSerif-Italic-webfont.eot?#iefix') format('embedded-opentype'), - url('../fonts/LiberationSerif-Italic-webfont.woff') format('woff'), - url('../fonts/LiberationSerif-Italic-webfont.ttf') format('truetype'), - url('../fonts/LiberationSerif-Italic-webfont.svg#liberation_serifitalic') format('svg'); + url('../fonts/LiberationSerif-Italic-webfont.woff') format('woff'), + url('../fonts/LiberationSerif-Italic-webfont.ttf') format('truetype'), + url('../fonts/LiberationSerif-Italic-webfont.svg#liberation_serifitalic') format('svg'); font-weight: normal; font-style: italic; } @@ -88,9 +88,9 @@ font-family: 'liberation_serif'; src: url('../fonts/LiberationSerif-Regular-webfont.eot'); src: url('../fonts/LiberationSerif-Regular-webfont.eot?#iefix') format('embedded-opentype'), - url('../fonts/LiberationSerif-Regular-webfont.woff') format('woff'), - url('../fonts/LiberationSerif-Regular-webfont.ttf') format('truetype'), - url('../fonts/LiberationSerif-Regular-webfont.svg#liberation_serifregular') format('svg'); + url('../fonts/LiberationSerif-Regular-webfont.woff') format('woff'), + url('../fonts/LiberationSerif-Regular-webfont.ttf') format('truetype'), + url('../fonts/LiberationSerif-Regular-webfont.svg#liberation_serifregular') format('svg'); font-weight: normal; font-style: normal; @@ -100,9 +100,9 @@ font-family: 'liberation_mono'; src: url('../fonts/LiberationMono-Bold-webfont.eot'); src: url('../fonts/LiberationMono-Bold-webfont.eot?#iefix') format('embedded-opentype'), - url('../fonts/LiberationMono-Bold-webfont.woff') format('woff'), - url('../fonts/LiberationMono-Bold-webfont.ttf') format('truetype'), - url('../fonts/LiberationMono-Bold-webfont.svg#liberation_monobold') format('svg'); + url('../fonts/LiberationMono-Bold-webfont.woff') format('woff'), + url('../fonts/LiberationMono-Bold-webfont.ttf') format('truetype'), + url('../fonts/LiberationMono-Bold-webfont.svg#liberation_monobold') format('svg'); font-weight: bold; font-style: normal; } @@ -111,9 +111,9 @@ font-family: 'liberation_mono'; src: url('../fonts/LiberationMono-BoldItalic-webfont.eot'); src: url('../fonts/LiberationMono-BoldItalic-webfont.eot?#iefix') format('embedded-opentype'), - url('../fonts/LiberationMono-BoldItalic-webfont.woff') format('woff'), - url('../fonts/LiberationMono-BoldItalic-webfont.ttf') format('truetype'), - url('../fonts/LiberationMono-BoldItalic-webfont.svg#liberation_monobold_italic') format('svg'); + url('../fonts/LiberationMono-BoldItalic-webfont.woff') format('woff'), + url('../fonts/LiberationMono-BoldItalic-webfont.ttf') format('truetype'), + url('../fonts/LiberationMono-BoldItalic-webfont.svg#liberation_monobold_italic') format('svg'); font-weight: bold; font-style: italic; } @@ -122,9 +122,9 @@ font-family: 'liberation_mono'; src: url('../fonts/LiberationMono-Italic-webfont.eot'); src: url('../fonts/LiberationMono-Italic-webfont.eot?#iefix') format('embedded-opentype'), - url('../fonts/LiberationMono-Italic-webfont.woff') format('woff'), - url('../fonts/LiberationMono-Italic-webfont.ttf') format('truetype'), - url('../fonts/LiberationMono-Italic-webfont.svg#liberation_monoitalic') format('svg'); + url('../fonts/LiberationMono-Italic-webfont.woff') format('woff'), + url('../fonts/LiberationMono-Italic-webfont.ttf') format('truetype'), + url('../fonts/LiberationMono-Italic-webfont.svg#liberation_monoitalic') format('svg'); font-weight: normal; font-style: italic; } @@ -133,26 +133,30 @@ font-family: 'liberation_mono'; src: url('../fonts/LiberationMono-Regular-webfont.eot'); src: url('../fonts/LiberationMono-Regular-webfont.eot?#iefix') format('embedded-opentype'), - url('../fonts/LiberationMono-Regular-webfont.woff') format('woff'), - url('../fonts/LiberationMono-Regular-webfont.ttf') format('truetype'), - url('../fonts/LiberationMono-Regular-webfont.svg#liberation_monoregular') format('svg'); + url('../fonts/LiberationMono-Regular-webfont.woff') format('woff'), + url('../fonts/LiberationMono-Regular-webfont.ttf') format('truetype'), + url('../fonts/LiberationMono-Regular-webfont.svg#liberation_monoregular') format('svg'); font-weight: normal; font-style: normal; } body { font-family: liberation_sans; - + position: relative; width: 40em; margin-top: 3em; margin-bottom: 3em; margin-left: auto; margin-right: auto; - + font-size: 1em; } +.nav-hide { + display: none; +} + main { /*margin-top: 3em; margin-bottom: 3em;*/ @@ -191,13 +195,15 @@ footer .border-wrapper { border-top: 1px solid #000; } -nav { - position: fixed; - /*right: 2em;*/ - left: 50%; - top: 10em; - margin-left: 22em; - width: 16em; +@media screen { + nav { + position: fixed; + /*right: 2em;*/ + left: 50%; + top: 10em; + margin-left: 22em; + width: 16em; + } } pre, code { @@ -241,4 +247,29 @@ main article section section section section h1 { main article section section section section.template-tag h1 { 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; } \ No newline at end of file diff --git a/ccm-sci-bundle/web/themes/foundry/foundry/lib/template-parser.xsl b/ccm-sci-bundle/web/themes/foundry/foundry/lib/template-parser.xsl index 742928a1d..26312aa1c 100644 --- a/ccm-sci-bundle/web/themes/foundry/foundry/lib/template-parser.xsl +++ b/ccm-sci-bundle/web/themes/foundry/foundry/lib/template-parser.xsl @@ -1,6 +1,7 @@ - ]> + + ]>