From d01d51a2679d1fb0e37fe6847b29447a38ebf4d4 Mon Sep 17 00:00:00 2001 From: jensp Date: Sat, 8 Nov 2014 17:55:30 +0000 Subject: [PATCH] Foundry support for NewsItem git-svn-id: https://svn.libreccm.org/ccm/trunk@2960 8810af33-2d31-482b-a856-94f89814c4df --- .../web/themes/foundry/conf/templates.xml | 3 + .../lib/template-tags/content-items.xsl | 23 +- .../lib/template-tags/content-items/news.xsl | 307 ++++++++++++++++++ .../foundry/lib/template-tags/html-tags.xsl | 4 + .../content-items/article-detail.xml | 4 + .../content-items/detail-default.xml | 3 + .../templates/content-items/news-detail.xml | 27 ++ 7 files changed, 349 insertions(+), 22 deletions(-) create mode 100644 ccm-sci-bundle/web/themes/foundry/foundry/lib/template-tags/content-items/news.xsl create mode 100644 ccm-sci-bundle/web/themes/foundry/templates/content-items/news-detail.xml diff --git a/ccm-sci-bundle/web/themes/foundry/conf/templates.xml b/ccm-sci-bundle/web/themes/foundry/conf/templates.xml index db3b53472..786039af8 100644 --- a/ccm-sci-bundle/web/themes/foundry/conf/templates.xml +++ b/ccm-sci-bundle/web/themes/foundry/conf/templates.xml @@ -17,6 +17,9 @@ content-items/article-detail.xml + + content-items/news-detail.xml + content-items/detail-default.xml diff --git a/ccm-sci-bundle/web/themes/foundry/foundry/lib/template-tags/content-items.xsl b/ccm-sci-bundle/web/themes/foundry/foundry/lib/template-tags/content-items.xsl index b4eb4963a..82b9abf06 100644 --- a/ccm-sci-bundle/web/themes/foundry/foundry/lib/template-tags/content-items.xsl +++ b/ccm-sci-bundle/web/themes/foundry/foundry/lib/template-tags/content-items.xsl @@ -30,6 +30,7 @@ version="2.0"> + @@ -538,26 +539,4 @@ - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/ccm-sci-bundle/web/themes/foundry/foundry/lib/template-tags/content-items/news.xsl b/ccm-sci-bundle/web/themes/foundry/foundry/lib/template-tags/content-items/news.xsl new file mode 100644 index 000000000..ebaa11051 --- /dev/null +++ b/ccm-sci-bundle/web/themes/foundry/foundry/lib/template-tags/content-items/news.xsl @@ -0,0 +1,307 @@ + + + + + + +

+ Outputs the the date of a news. The news-date must contain at least + one format element. The format element encloses the + format definition for the specific language or the default format. The language + for which a format is used is provided using the lang attribute at the + format element. The default format has a default attribute + with the value true. An example: +

+
+                <news-date>
+                    <format default="true">
+                        <iso-date/>
+                    </format>
+                    <format lang="de">
+                        <day zero="true"/>.<month zero="true"/>.<year/>
+                    </format>
+                </news-date>
+            
+

+ In this example a visitor with a browser using German as default locale + will see the news date in the date format that common in Germany + (dd.mm.yyyy). For all other languages, the default format is used. + In this case the iso-format is used. +

+
+
+ + + + + + + + + + + + + +

+ Outputs the news date in the short format as provided in the data tree by CCM. +

+
+
+ + + + + + + + + + + + + + + +

+ Outputs the news date in the long format as provided in the data tree by CCM. +

+
+
+ + + + + + + + + + + + + + + + +

+ A short hand template to output the news date in ISO8601 style (yyyy-mm-dd). +

+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+ Outputs the year of a news date. If the short attribute is set to + true only the last two columns are shown. +

+
+ + +

+ If set to true only the last two digits of the year are shown. +

+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

+ Outputs the month part of the news date. If the value has only one digit it is + prefixed by a zero by default. +

+
+ + +

+ If set to false one digit values (months from 1 to 9) are not + prefixed with a zero. +

+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

+ Outputs the month name as provided in the data tree by CCM. +

+
+
+ + + + + + + + + + + + + + + +

+ Outputs the day part of the news date. If the value has only one digit it is + prefixed by a zero by default. +

+
+ + +

+ If set to false one digit values (days from 1 to 9) are not + prefixed with a zero. +

+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + +
+ \ No newline at end of file diff --git a/ccm-sci-bundle/web/themes/foundry/foundry/lib/template-tags/html-tags.xsl b/ccm-sci-bundle/web/themes/foundry/foundry/lib/template-tags/html-tags.xsl index b4116e1ba..8d49f0f82 100644 --- a/ccm-sci-bundle/web/themes/foundry/foundry/lib/template-tags/html-tags.xsl +++ b/ccm-sci-bundle/web/themes/foundry/foundry/lib/template-tags/html-tags.xsl @@ -476,6 +476,10 @@
+
language
+
+ +
diff --git a/ccm-sci-bundle/web/themes/foundry/templates/content-items/article-detail.xml b/ccm-sci-bundle/web/themes/foundry/templates/content-items/article-detail.xml index 946fc800a..1f928aa12 100644 --- a/ccm-sci-bundle/web/themes/foundry/templates/content-items/article-detail.xml +++ b/ccm-sci-bundle/web/themes/foundry/templates/content-items/article-detail.xml @@ -1,6 +1,10 @@ +

+ +

+
diff --git a/ccm-sci-bundle/web/themes/foundry/templates/content-items/detail-default.xml b/ccm-sci-bundle/web/themes/foundry/templates/content-items/detail-default.xml index a3e1a5e4c..3d4f29220 100644 --- a/ccm-sci-bundle/web/themes/foundry/templates/content-items/detail-default.xml +++ b/ccm-sci-bundle/web/themes/foundry/templates/content-items/detail-default.xml @@ -1,5 +1,8 @@ +

+ +

diff --git a/ccm-sci-bundle/web/themes/foundry/templates/content-items/news-detail.xml b/ccm-sci-bundle/web/themes/foundry/templates/content-items/news-detail.xml new file mode 100644 index 000000000..06b3de79d --- /dev/null +++ b/ccm-sci-bundle/web/themes/foundry/templates/content-items/news-detail.xml @@ -0,0 +1,27 @@ + + + +

+ +

+ +
+ +
+ +
+ + + + + + .. + + +
+ +
+ +
+ +
\ No newline at end of file