Bugfixes for Freemarker functions
git-svn-id: https://svn.libreccm.org/ccm/trunk@6078 8810af33-2d31-482b-a856-94f89814c4dfmaster
parent
41699a4488
commit
4e64dd8def
|
|
@ -20,6 +20,10 @@
|
|||
<#return model["/bebop:page/nav:categoryPath/nav:category[last()]"]>
|
||||
</#function>
|
||||
|
||||
<#function getSelectedCategoryId>
|
||||
<#return model["/bebop:page/nav:categoryPath/nav:category[last()]/@id"]>
|
||||
</#function>
|
||||
|
||||
<#--
|
||||
Get the title of the provided category.
|
||||
-->
|
||||
|
|
@ -82,6 +86,10 @@
|
|||
<#return ofCategory["./nav:category"]>
|
||||
</#function>
|
||||
|
||||
<#function getSubCategoriesOfCategoryWithId categoryId>
|
||||
<#return model["/bebop:page/nav:categoryMenu//nav:category[@id=${categoryId}]/nav:category"]>
|
||||
</#function>
|
||||
|
||||
<#function getGreetingItem>
|
||||
<#return model["/bebop:page/nav:greetingItem/cms:item"]>
|
||||
</#function>
|
||||
|
|
@ -26,7 +26,7 @@
|
|||
</#function>
|
||||
|
||||
<#function getObjectCount listId>
|
||||
<#return model["/bebop:page/*[@id='${listId}']/nav:objectList/nav:paginator/@objectCount"].@@text?number>
|
||||
<#return model["/bebop:page/*[@id='${listId}']/nav:objectList/nav:paginator/@objectCount"]?number>
|
||||
</#function>
|
||||
|
||||
<#function getPaginatorBaseUrl listId>
|
||||
|
|
@ -39,11 +39,11 @@
|
|||
</#function>
|
||||
|
||||
<#function getPaginatorBegin listId>
|
||||
<#return model["/bebop:page/*[@id='${listId}']/nav:objectList/nav:paginator/@objectBegin"].@@text?number>
|
||||
<#return model["/bebop:page/*[@id='${listId}']/nav:objectList/nav:paginator/@objectBegin"]?number>
|
||||
</#function>
|
||||
|
||||
<#function getPaginatorEnd listId>
|
||||
<#return model["/bebop:page/*[@id='${listId}']/nav:objectList/nav:paginator/@objectEnd"].@@text?number>
|
||||
<#return model["/bebop:page/*[@id='${listId}']/nav:objectList/nav:paginator/@objectEnd"]?number>
|
||||
</#function>
|
||||
|
||||
<#function getPageCount listId>
|
||||
|
|
@ -56,7 +56,7 @@
|
|||
</#function>
|
||||
|
||||
<#function getPageNumber listId>
|
||||
<#return model["/bebop:page/*[@id='${listId}']/nav:objectList/nav:paginator/@pageNumber"].@@text?number>
|
||||
<#return model["/bebop:page/*[@id='${listId}']/nav:objectList/nav:paginator/@pageNumber"]?number>
|
||||
</#function>
|
||||
|
||||
<#function getPageParam listId>
|
||||
|
|
@ -64,7 +64,7 @@
|
|||
</#function>
|
||||
|
||||
<#function getPageSize listId>
|
||||
<#return model["/bebop:page/*[@id='${listId}']/nav:objectList/nav:paginator/@pageSize"].@@text?number>
|
||||
<#return model["/bebop:page/*[@id='${listId}']/nav:objectList/nav:paginator/@pageSize"]?number>
|
||||
</#function>
|
||||
|
||||
<#function getPrevPageLink listId>
|
||||
|
|
@ -100,11 +100,15 @@
|
|||
</#function>
|
||||
|
||||
<#function hasImage item>
|
||||
<#return (item["./nav:attribute[@name='imageAttachments.image.id']"]?size > 0)>
|
||||
<#return (item["./nav:attribute[@name='imageAttachments.image.id']"]?size > 0 || item["./imageAttachments"]?size > 0)>
|
||||
</#function>
|
||||
|
||||
<#function getImageId item>
|
||||
<#return item["./nav:attribute[@name='imageAttachments.image.id'][1]"]>
|
||||
<#if (item["./nav:attribute[@name='imageAttachments.image.id']"]?size > 0)>
|
||||
<#return item["./nav:attribute[@name='imageAttachments.image.id'][1]"]>
|
||||
<#elseif (item["./imageAttachments"]?size > 0)>
|
||||
<#return item["./imageAttachments[1]/image/id"].@@text>
|
||||
</#if>
|
||||
</#function>
|
||||
|
||||
<#function getImageUrl item>
|
||||
|
|
@ -112,7 +116,11 @@
|
|||
</#function>
|
||||
|
||||
<#function getImageCaption item>
|
||||
<#return item["./nav:attribute[@name='imageAttachments.image.caption'][1]"].@@text>
|
||||
<#if (item["./nav:attribute[@name='imageAttachments.image.id']"]?size > 0)>
|
||||
<#return item["./nav:attribute[@name='imageAttachments.image.caption'][1]"].@@text>
|
||||
<#elseif (item["./imageAttachments"]?size > 0)>
|
||||
<#return item["./imageAttachments[1]/image/caption"].@@text>
|
||||
</#if>
|
||||
</#function>
|
||||
|
||||
<#function getFilters listId>
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
"ui": "http://www.arsdigita.com/ui/1.0"}
|
||||
>
|
||||
|
||||
<#import ../ccm-cms/content-item.ftl as ContentItem>
|
||||
<#import "/ccm-cms/content-item.ftl" as ContentItem>
|
||||
|
||||
<#function getDescription data>
|
||||
<#if (data["./instituteDesc"]?size > 0)>
|
||||
|
|
@ -16,12 +16,12 @@
|
|||
</#function>
|
||||
|
||||
<#function getShortDescription data>
|
||||
<#if (data["./instituteShortDescription"])>
|
||||
<#return data["./departmentShortDescription"])>
|
||||
<#elseif (data["./shortDescription"])>
|
||||
<#return data["./shortDescription"])>
|
||||
<#elseif (data["./shortDesc"])>
|
||||
<#return data["./shortDesc"])>
|
||||
<#if (data["./instituteShortDescription"]?size > 0)>
|
||||
<#return data["./departmentShortDescription"]>
|
||||
<#elseif (data["./shortDescription"]?size > 0)>
|
||||
<#return data["./shortDescription"]>
|
||||
<#elseif (data["./shortDesc"]?size > 0)>
|
||||
<#return data["./shortDesc"]>
|
||||
</#if>
|
||||
</#function>
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue