From ac03112ca96995fcb97f62767cd9f888efc23534 Mon Sep 17 00:00:00 2001 From: jensp Date: Mon, 18 Feb 2019 19:28:07 +0000 Subject: [PATCH] Some Freemarker Macros for ccm-navigation git-svn-id: https://svn.libreccm.org/ccm/trunk@5832 8810af33-2d31-482b-a856-94f89814c4df --- .../ccm-navigation/macros/navigation.ftl | 44 +++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 ccm-navigation/web/themes/freemarker/ccm-navigation/macros/navigation.ftl diff --git a/ccm-navigation/web/themes/freemarker/ccm-navigation/macros/navigation.ftl b/ccm-navigation/web/themes/freemarker/ccm-navigation/macros/navigation.ftl new file mode 100644 index 000000000..fe1b7f08c --- /dev/null +++ b/ccm-navigation/web/themes/freemarker/ccm-navigation/macros/navigation.ftl @@ -0,0 +1,44 @@ +<#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"} +> + +<%-- + Output all path tokens of the current category path. Provides the + following parameters for nested content: + + 1: title + 2: url + 3: id + + of the category. +--%> +<#macro categoryPath> + + <#list model["/bebop:page/nav:categoryPath/nav:category"] as token> + <#nested token["./@title"], token["./@url"], token["./@id"]> + + + + +<%-- + Provides the following data about the current navigation instance to + the nested content: + + 1. ID of the navigation menu from which the data was retrieved + 2. URL to the root of the navigation + 3. title of the navigation +--%> +<#macro navigationRoot navId="categoryMenu"> + + + + + <#assign url=model["/bebop:page/nav:categoryMenu[@id='${navId}']/nav:category/@url"]> + <#assign title=model["/bebop:page/nav:categoryMenu[@id='categoryMenu']/nav:category/@title"]> + + <#nested navId, url, title> + +