Documentation for ccm-cms-types-image.ftl

git-svn-id: https://svn.libreccm.org/ccm/trunk@6302 8810af33-2d31-482b-a856-94f89814c4df
master
jensp 2019-11-03 12:48:02 +00:00
parent 142074d7c1
commit 698604870a
1 changed files with 144 additions and 0 deletions

View File

@ -5,6 +5,17 @@
"ui": "http://www.arsdigita.com/ui/1.0"}
>
<#--filedoc
Functions for processing image items.
-->
<#--doc
Get the artist of the image.
@param The model of the image item to use.
@return The value of the `artist` property of the image.
-->
<#function getArtist item>
<#if (item["./artist"]?size > 0)>
<#return item["./artist"]>
@ -13,6 +24,13 @@
</#if>
</#function>
<#--doc
Get the copyright of the image.
@param The model of the image item to use.
@return The value of the `copyright` property of the image.
-->
<#function getCopyright item>
<#if (item["./copyright"]?size > 0)>
<#return item["./copyright"]>
@ -21,6 +39,13 @@
</#if>
</#function>
<#--doc
Get the description of the image.
@param The model of the image item to use.
@return The value of the `description` property of the image.
-->
<#function getDescription item>
<#if (item["./description"]?size > 0)>
<#return item["./description"]>
@ -29,6 +54,13 @@
</#if>
</#function>
<#--doc
Get the license of the image.
@param The model of the image item to use.
@return The value of the `license` property of the image.
-->
<#function getLicense item>
<#if (item["./license"]?size > 0)>
<#return item["./license"]>
@ -37,6 +69,13 @@
</#if>
</#function>
<#--doc
Get the material of the image.
@param The model of the image item to use.
@return The value of the `material` property of the image.
-->
<#function getMaterial item>
<#if (item["./material"]?size > 0)>
<#return item["./material"]>
@ -45,6 +84,13 @@
</#if>
</#function>
<#--doc
Get the publish date of the image.
@param The model of the image item to use.
@return The value of the `publishDate` property of the image.
-->
<#function getPublishDate item>
<#if (item["./publishDate"]?size > 0)>
<#return item["./publishDate"]>
@ -53,6 +99,13 @@
</#if>
</#function>
<#--doc
Get the width of the image.
@param The model of the image item to use.
@return The value of the `width` property of the image.
-->
<#function getWidth item>
<#if (item["./images/width"]?size > 0)>
<#return item["./image/width"]>
@ -61,6 +114,13 @@
</#if>
</#function>
<#--doc
Get the height of the image.
@param The model of the image item to use.
@return The value of the `height` property of the image.
-->
<#function getHeight item>
<#if (item["./images/height"]?size > 0)>
<#return item["./images/height"]>
@ -69,10 +129,24 @@
</#if>
</#function>
<#--doc
Get the main text of the image.
@param The model of the image item to use.
@return The value of the `main text` property of the image.
-->
<#function getMainText item>
<#return item["./textAsset/content"]>
</#function>
<#--doc
Get the origin of the image.
@param The model of the image item to use.
@return The value of the `origin` property of the image.
-->
<#function getOrigin item>
<#if (item["./origin"]?size > 0)>
<#return item["./origin"]>
@ -81,6 +155,13 @@
</#if>
</#function>
<#--doc
Get the original size of the image.
@param The model of the image item to use.
@return The value of the `originalSize` property of the image.
-->
<#function getOriginalSize item>
<#if (item["./origSize"]?size > 0)>
<#return item["./origSize"]>
@ -89,38 +170,101 @@
</#if>
</#function>
<#--doc
Get the URL of the image.
@param The model of the image item to use.
@return The value of the `url` property of the image.
-->
<#function getUrl item>
<#return "${contextPrefix}/cms-service/stream/image/?image_id=${getImageId(item)}">
</#function>
<#--doc
Get the caption of the image.
@param The model of the image item to use.
@return The value of the `caption` property of the image.
-->
<#function getCaption item>
<#return item["./caption"]>
</#function>
<#--doc
Get the ID of the image.
@param The model of the image item to use.
@return The value of the `id` property of the image.
-->
<#function getImageId item>
<#return item["./image/id"]>
</#function>
<#--doc
Get the thumbnail id of the image.
@param The model of the image item to use.
@return The value of the `thumbnail/id` property of the image.
-->
<#function getThumbnailId item>
<#return item["./thumbnail/id"]>
</#function>
<#--doc
Get the width of the thumbnail of the image.
@param The model of the image item to use.
@return The width of the thumbnail of the image.
-->
<#function getThumbnailWidth item>
<#return item["./thumbnail/width"]>
</#function>
<#--doc
Get the height of the thumbnail of the image.
@param The model of the image item to use.
@return The height of the thumbnail of the image.
-->
<#function getThumbnailHeight item>
<#return item["./thumbnail/height"]>
</#function>
<#--doc
Get the site of the image.
@param The model of the image item to use.
@return The value of the `site` property of the image.
-->
<#function getSite item>
<#return item["./site"]>
</#function>
<#--doc
Get the source of the image.
@param The model of the image item to use.
@return The value of the `source` property of the image.
-->
<#function getSource item>
<#return item["./source"]>
</#function>
<#--doc
Get the technique of the image.
@param The model of the image item to use.
@return The value of the `technique` property of the image.
-->
<#function getTechnique item>
<#return item["./technique"]>
</#function>