diff --git a/ccm-cms-types-article/web/themes/freemarker/ccm-cms-types-article/macros/article.ftl b/ccm-cms-types-article/web/themes/freemarker/ccm-cms-types-article/macros/article.ftl index 2bc18f26f..079effaed 100644 --- a/ccm-cms-types-article/web/themes/freemarker/ccm-cms-types-article/macros/article.ftl +++ b/ccm-cms-types-article/web/themes/freemarker/ccm-cms-types-article/macros/article.ftl @@ -5,12 +5,20 @@ "ui": "http://www.arsdigita.com/ui/1.0"} > +<#-- + Outputs the lead text the provided article. +--> <#macro lead item> <#if (item["./lead"]?size > 0)> ${item["./lead"]} + <#elseif (item["./nav:attribute[@name='lead']"]?size > 0)> + ${item["./nav:attribute[@name='lead']"]} #if> #macro> +<#-- + Output the main text of the provided article. +--> <#macro main item> <#if (item["./textAsset"]?size > 0)> ${item["./textAsset/content"]} diff --git a/ccm-cms-types-event/web/themes/freemarker/macros/ccm-cms-types-event.ftl b/ccm-cms-types-event/web/themes/freemarker/macros/ccm-cms-types-event.ftl new file mode 100644 index 000000000..165774d90 --- /dev/null +++ b/ccm-cms-types-event/web/themes/freemarker/macros/ccm-cms-types-event.ftl @@ -0,0 +1,191 @@ +<#ftl ns_prefixes={ +"bebop":"http://www.arsdigita.com/bebop/1.0", +"cms":"http://www.arsdigita.com/cms/1.0", +"nav":"http://ccm.redhat.com/navigation", +"ui": "http://www.arsdigita.com/ui/1.0"} +> + +<#-- + Outputs the lead text of the provided event. +--> +<#macro lead item> + <#if (item["./lead"]?size > 0)> + ${item["./lead"]} + <#elseif (item["./nav:attribute[@name='lead']"]?size > 0)> + ${item["./nav:attribute[@name='lead']"]} + #if> +#macro> + +<#-- + Output the main text of the provided event. +--> +<#macro main item> + <#if (item["./textAsset"]?size > 0)> + ${item["./textAsset/content"]} + #if> +#macro> + +<#macro endDate item> + <#if (item["./endDate"]?size > 0)> + ${item["./endDate"]} + <#elseif (item["./nav:attribute[@name='endDate']"]?size > 0)> + ${item["./nav:attribute[@name='endDate']"]} + #if> +#macro> + +<#macro endDateYear item> + <#if (item["./endDate"]?size > 0)> + ${item["./endDate/@year"]} + <#elseif (item["./nav:attribute[@name='endDate']"]?size > 0)> + ${item["./nav:attribute[@name='endDate']/@year"]} + #if> +#macro> + +<#macro endDateMonth item> + <#if (item["./endDate"]?size > 0)> + ${item["./endDate/@month"]} + <#elseif (item["./nav:attribute[@name='endDate']"]?size > 0)> + ${item["./nav:attribute[@name='endDate']/@month"]} + #if> +#macro> + +<#macro endDateDay item> + <#if (item["./endDate"]?size > 0)> + ${item["./endDate/@day"]} + <#elseif (item["./nav:attribute[@name='endDate']"]?size > 0)> + ${item["./nav:attribute[@name='endDate']/@day"]} + #if> +#macro> + +<#macro endDateDayNameShort item> + <#if (item["./endDate"]?size > 0)> + ${item["./endDate/@dayNameShort"]} + <#elseif (item["./nav:attribute[@name='endDate']"]?size > 0)> + ${item["./nav:attribute[@name='endDate']/@dayNameShort"]} + #if> +#macro> + +<#macro endDateHour item> + <#if (item["./endDate"]?size > 0)> + ${item["./endDate/@hour"]} + <#elseif (item["./nav:attribute[@name='endDate']"]?size > 0)> + ${item["./nav:attribute[@name='endDate']/@hour"]} + #if> +#macro> + +<#macro endDateMinute item> + <#if (item["./endDate"]?size > 0)> + ${item["./endDate/@minute"]} + <#elseif (item["./nav:attribute[@name='endDate']"]?size > 0)> + ${item["./nav:attribute[@name='endDate']/@minute"]} + #if> +#macro> + +<#macro endDateSecond item> + <#if (item["./endDate"]?size > 0)> + ${item["./endDate/@second"]} + <#elseif (item["./nav:attribute[@name='endDate']"]?size > 0)> + ${item["./nav:attribute[@name='endDate']/@second"]} + #if> +#macro> + +<#macro endDate item> + <#if (item["./endDate"]?size > 0)> + ${item["./endDate"]} + <#elseif (item["./nav:attribute[@name='endDate']"]?size > 0)> + ${item["./nav:attribute[@name='endDate']"]} + #if> +#macro> + +<#macro endDateYear item> + <#if (item["./endDate"]?size > 0)> + ${item["./endDate/@year"]} + <#elseif (item["./nav:attribute[@name='endDate']"]?size > 0)> + ${item["./nav:attribute[@name='endDate']/@year"]} + #if> +#macro> + +<#macro endDateMonth item> + <#if (item["./endDate"]?size > 0)> + ${item["./endDate/@month"]} + <#elseif (item["./nav:attribute[@name='endDate']"]?size > 0)> + ${item["./nav:attribute[@name='endDate']/@month"]} + #if> +#macro> + +<#macro endDateDay item> + <#if (item["./endDate"]?size > 0)> + ${item["./endDate/@day"]} + <#elseif (item["./nav:attribute[@name='endDate']"]?size > 0)> + ${item["./nav:attribute[@name='endDate']/@day"]} + #if> +#macro> + +<#macro endDateDayNameShort item> + <#if (item["./endDate"]?size > 0)> + ${item["./endDate/@dayNameShort"]} + <#elseif (item["./nav:attribute[@name='endDate']"]?size > 0)> + ${item["./nav:attribute[@name='endDate']/@dayNameShort"]} + #if> +#macro> + +<#macro endDateHour item> + <#if (item["./endDate"]?size > 0)> + ${item["./endDate/@hour"]} + <#elseif (item["./nav:attribute[@name='endDate']"]?size > 0)> + ${item["./nav:attribute[@name='endDate']/@hour"]} + #if> +#macro> + +<#macro endDateMinute item> + <#if (item["./endDate"]?size > 0)> + ${item["./endDate/@minute"]} + <#elseif (item["./nav:attribute[@name='endDate']"]?size > 0)> + ${item["./nav:attribute[@name='endDate']/@minute"]} + #if> +#macro> + +<#macro endDateSecond item> + <#if (item["./endDate"]?size > 0)> + ${item["./endDate/@second"]} + <#elseif (item["./nav:attribute[@name='endDate']"]?size > 0)> + ${item["./nav:attribute[@name='endDate']/@second"]} + #if> +#macro> + +<#macro location item> + <#if (item["./location"]?size > 0)> + ${item["./location"]} + #if> +#macro> + +<#macro mainContributor item> + <#if (item["./mainContributor"]?size > 0)> + ${item["./mainContributor"]} + <#/if> +#macro> + +<#macro eventType item> + <#if (item["./eventType"]?size > 0)> + ${item["./eventType"]} + <#/if> +#macro> + +<#macro cost item> + <#if (item["./cost"]?size > 0)> + ${item[./cost"]} + #if> +#macro> + +<#macro mapLink item> + <#if (item["./mapLink"]?size > 0)> + <#nested item["./mapLink"> + #if> +#macro> + + + + + + + diff --git a/ccm-cms-types-newsitem/web/themes/freemarker/macros/ccm-cms-types-newsitem.ftl b/ccm-cms-types-newsitem/web/themes/freemarker/macros/ccm-cms-types-newsitem.ftl new file mode 100644 index 000000000..ca6560d88 --- /dev/null +++ b/ccm-cms-types-newsitem/web/themes/freemarker/macros/ccm-cms-types-newsitem.ftl @@ -0,0 +1,116 @@ +<#ftl ns_prefixes={ +"bebop":"http://www.arsdigita.com/bebop/1.0", +"cms":"http://www.arsdigita.com/cms/1.0", +"nav":"http://ccm.redhat.com/navigation", +"ui": "http://www.arsdigita.com/ui/1.0"} +> + +<#-- + Outputs the lead text of the provided news item. +--> +<#macro lead item> + <#if (item["./lead"]?size > 0)> + ${item["./lead"]} + <#elseif (item["./nav:attribute[@name='lead']"]?size > 0)> + ${item["./nav:attribute[@name='lead']"]} + #if> +#macro> + +<#-- + Output the main text of the provided news item. +--> +<#macro main item> + <#if (item["./textAsset"]?size > 0)> + ${item["./textAsset/content"]} + #if> +#macro> + +<#-- + Outputs value of the date property of the provided news item as provided by the model. +--> +<#macro newsDate item> + <#if (item["./newsDate"]?size > 0)> + ${item["./newsDate"]} + <#elseif (item["./nav:attribute[@name='newsDate']"]?size > 0)> + ${item["./nav:attribute[@name='newsDate']"]} + #if> +#macro> + +<#-- + Outputs the year part of the date property of the provided news item. +--> +<#macro newsDateYear item> + <#if (item["./newsDate"]?size > 0)> + ${item["./newsDate/@year"]} + <#elseif (item["./nav:attribute[@name='newsDate']"]?size > 0)> + ${item["./nav:attribute[@name='newsDate']/@year"]} + #if> +#macro> + +<#-- + Outputs the month part of the date property of the provided news item. +--> +<#macro newsDateMonth item> + <#if (item["./newsDate"]?size > 0)> + ${item["./newsDate/@month"]} + <#elseif (item["./nav:attribute[@name='newsDate']"]?size > 0)> + ${item["./nav:attribute[@name='newsDate']/@month"]} + #if> +#macro> + +<#-- + Outputs the day part of the date property of the provided news item. +--> +<#macro newsDateDay item> + <#if (item["./newsDate"]?size > 0)> + ${item["./newsDate/@day"]} + <#elseif (item["./nav:attribute[@name='newsDate']"]?size > 0)> + ${item["./nav:attribute[@name='newsDate']/@day"]} + #if> +#macro> + +<#-- + Outputs the short day name of the date property of the provided news item. +--> +<#macro newsDateDayNameShort item> + <#if (item["./newsDate"]?size > 0)> + ${item["./newsDate/@dayNameShort"]} + <#elseif (item["./nav:attribute[@name='newsDate']"]?size > 0)> + ${item["./nav:attribute[@name='newsDate']/@dayNameShort"]} + #if> +#macro> + +<#-- + Outputs the hour part of the date property of the provided news item. +--> +<#macro newsDateHour item> + <#if (item["./newsDate"]?size > 0)> + ${item["./newsDate/@hour"]} + <#elseif (item["./nav:attribute[@name='newsDate']"]?size > 0)> + ${item["./nav:attribute[@name='newsDate']/@hour"]} + #if> +#macro> + +<#-- + Outputs the minute part of the date property of the provided news item. +--> +<#macro newsDateMinute item> + <#if (item["./newsDate"]?size > 0)> + ${item["./newsDate/@minute"]} + <#elseif (item["./nav:attribute[@name='newsDate']"]?size > 0)> + ${item["./nav:attribute[@name='newsDate']/@minute"]} + #if> +#macro> + +<#-- + Outputs the second part of the date property of the provided news item. +--> +<#macro newsDateSecond item> + <#if (item["./newsDate"]?size > 0)> + ${item["./newsDate/@second"]} + <#elseif (item["./nav:attribute[@name='newsDate']"]?size > 0)> + ${item["./nav:attribute[@name='newsDate']/@second"]} + #if> +#macro> + +h \ No newline at end of file diff --git a/ccm-cms/web/themes/freemarker/ccm-cms/macros/contentitems.ftl b/ccm-cms/web/themes/freemarker/ccm-cms/macros/contentitems.ftl new file mode 100644 index 000000000..ac48f7ac2 --- /dev/null +++ b/ccm-cms/web/themes/freemarker/ccm-cms/macros/contentitems.ftl @@ -0,0 +1,43 @@ +<#ftl ns_prefixes={ +"bebop":"http://www.arsdigita.com/bebop/1.0", +"cms":"http://www.arsdigita.com/cms/1.0", +"nav":"http://ccm.redhat.com/navigation", +"ui": "http://www.arsdigita.com/ui/1.0"} +> + +<#-- + Passed the content item provided by the model to the nested content if + the model provides a content item. +--> +<#macro contentPage> + + <#nested model["/bebop:page/cms:contentPanel/cms:item"]> + +#macro> + +<#-- + Includes the template for the type of the provided content item + for the provided view and style. The paramters view and style are + optional. If not provided the default value "detail" is used for + the view parameter. +--> +<#macro contentItem item view="detail" style=""> + + <#include getContentItemTemplate(item, view, style)> + + <#--
+ Using content item template ${getContentItemTemplate(item, view, style)}
+ -->
+
+#macro>
+
+<#--
+ Outputs the title of the provided content item.
+-->
+<#macro title item>
+ <#if (item["./title"]?size > 0)>
+ ${item["./title"]}
+ <#elseif (item["./nav:attribute[@name='title']"]?size > 0)>
+ ${item["./nav:attribute[@name='title']"]}
+ #if>
+#macro>
\ No newline at end of file
diff --git a/ccm-navigation/web/themes/freemarker/ccm-navigation/macros/navigation.ftl b/ccm-navigation/web/themes/freemarker/ccm-navigation/macros/navigation.ftl
index 14e58d613..0d5fa1cf4 100644
--- a/ccm-navigation/web/themes/freemarker/ccm-navigation/macros/navigation.ftl
+++ b/ccm-navigation/web/themes/freemarker/ccm-navigation/macros/navigation.ftl
@@ -105,6 +105,11 @@
#macro>
+<#--
+ Checks of the provided category has subcategories. If the category
+ has subcategories they are passed to the nested content and can be
+ used to iterate over them.
+-->
<#macro subCategories ofCategory>
<#if (ofCategory["./nav:category"]?size > 0)>
@@ -113,6 +118,9 @@
#macro>
+<#--
+ Passed the GreetingItem provided by the model to the nested content if their is an GreetingItem.
+-->
<#macro greetingItem>
<#nested model["/bebop:page/nav:greetingItem/cms:item"]>