From 698604870a2429465b28d0f64220363a2001fa59 Mon Sep 17 00:00:00 2001 From: jensp Date: Sun, 3 Nov 2019 12:48:02 +0000 Subject: [PATCH] Documentation for ccm-cms-types-image.ftl git-svn-id: https://svn.libreccm.org/ccm/trunk@6302 8810af33-2d31-482b-a856-94f89814c4df --- .../web/freemarker/ccm-cms-types-image.ftl | 144 ++++++++++++++++++ 1 file changed, 144 insertions(+) diff --git a/ccm-cms-types-image/web/freemarker/ccm-cms-types-image.ftl b/ccm-cms-types-image/web/freemarker/ccm-cms-types-image.ftl index 1ad0265c7..176843eec 100644 --- a/ccm-cms-types-image/web/freemarker/ccm-cms-types-image.ftl +++ b/ccm-cms-types-image/web/freemarker/ccm-cms-types-image.ftl @@ -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 @@ +<#--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 @@ +<#--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 @@ +<#--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 @@ +<#--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 @@ +<#--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 @@ +<#--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 @@ +<#--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 @@ +<#--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"]> +<#--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 @@ +<#--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 @@ +<#--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)}"> +<#--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"]> +<#--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"]> +<#--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"]> +<#--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"]> +<#--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"]> +<#--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"]> +<#--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"]> +<#--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"]> \ No newline at end of file