diff --git a/ccm-cms/web/themes/freemarker/ccm-cms/content-item.ftl b/ccm-cms/web/themes/freemarker/ccm-cms/content-item.ftl index 73276c822..1efda5606 100644 --- a/ccm-cms/web/themes/freemarker/ccm-cms/content-item.ftl +++ b/ccm-cms/web/themes/freemarker/ccm-cms/content-item.ftl @@ -14,6 +14,16 @@ 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. + + @param {node} item The data model of the content item itself. There are + several functions for extracting this provided by other modules. + + @param {string} view View type to use. Either `detail` or `list`. Default + value is `detail`. + + @param {string} style Style to use. Styles allow it to use different + templates for `detail` or `list` views depending on the context were the + content item is displayed. --> <#macro contentItem item view="detail" style=""> diff --git a/ccm-navigation/web/themes/freemarker/ccm-navigation/object-list.ftl b/ccm-navigation/web/themes/freemarker/ccm-navigation/object-list.ftl index d159e23d2..8e5ed253c 100644 --- a/ccm-navigation/web/themes/freemarker/ccm-navigation/object-list.ftl +++ b/ccm-navigation/web/themes/freemarker/ccm-navigation/object-list.ftl @@ -96,7 +96,11 @@ <#function getItemLink item> - <#return item["./nav:path"].@@text> + <#if (item["./nav:path"]?size > 0)> + <#return item["./nav:path"].@@text> + <#else> + <#return "/redirect/?oid=" + item["./@oid"]> + <#function getItemLead item> diff --git a/ccm-sci-publications-navigation/web/themes/freemarker/ccm-sci-publications-navigation.ftl b/ccm-sci-publications-navigation/web/themes/freemarker/ccm-sci-publications-navigation.ftl index 753581e1e..a83fc4678 100644 --- a/ccm-sci-publications-navigation/web/themes/freemarker/ccm-sci-publications-navigation.ftl +++ b/ccm-sci-publications-navigation/web/themes/freemarker/ccm-sci-publications-navigation.ftl @@ -82,7 +82,7 @@ <#function getPublicationObjectType item> - <#return item["./object-type"].@@text> + <#return item["./@object-type"]> <#function getPublicationTitle item> diff --git a/ccm-sci-publications/web/themes/freemarker/ccm-sci-publications/authors.ftl b/ccm-sci-publications/web/themes/freemarker/ccm-sci-publications/authors.ftl index 8acddf110..31d341e07 100644 --- a/ccm-sci-publications/web/themes/freemarker/ccm-sci-publications/authors.ftl +++ b/ccm-sci-publications/web/themes/freemarker/ccm-sci-publications/authors.ftl @@ -9,6 +9,10 @@ <#return author["./contacts/contact/contactentries[./keyId = '${keyId}']/value"]> +<#function hasLink author keyId> + <#return (author["./contacts/contact/contactentries[./keyId = '${keyId}']"]?size > 0)> + + <#function getId author> <#return author["./masterVersion/id"] + "_" + author["./@name"]> @@ -21,10 +25,18 @@ <#return author["./last()"]> +<#function hasSurname author> + <#return (author["./surname"]?size > 0)> + + <#function getSurname author> <#return author["./surname"]> +<#function hasGivenName author> + <#return (author["./givenname"]?size > 0)> + + <#function getGivenName author> <#return author["./givenname"]> diff --git a/ccm-sci-publications/web/themes/freemarker/ccm-sci-publications/export-links.ftl b/ccm-sci-publications/web/themes/freemarker/ccm-sci-publications/export-links.ftl index e9d8bf1fe..71bd1f3ab 100644 --- a/ccm-sci-publications/web/themes/freemarker/ccm-sci-publications/export-links.ftl +++ b/ccm-sci-publications/web/themes/freemarker/ccm-sci-publications/export-links.ftl @@ -5,6 +5,14 @@ "ui": "http://www.arsdigita.com/ui/1.0"} > +<#function getExportLinks item> + <#return item["./publicationExportLink"]> + + +<#function hasExportLinks item> + <#return (item["./publicationExportLink"]?size > 0)> + + <#function getHref exportLink> <#return "${dispatcherPrefix}/scipublications/export/?format=${exportLink['./formatKey']}&publication=${exportLink['./publicationId']}"> diff --git a/ccm-sci-publications/web/themes/freemarker/ccm-sci-publications/publications.ftl b/ccm-sci-publications/web/themes/freemarker/ccm-sci-publications/publications.ftl index 08ae361d4..4b6706f37 100644 --- a/ccm-sci-publications/web/themes/freemarker/ccm-sci-publications/publications.ftl +++ b/ccm-sci-publications/web/themes/freemarker/ccm-sci-publications/publications.ftl @@ -50,7 +50,11 @@ <#function isReviewed item> - <#return item["./reviewed"] == "true"> + <#if (item["./reviewed"]?size > 0)> + <#return item["./reviewed"] == "true"> + <#else> + <#return false> + <#function getAbstract item> @@ -61,8 +65,8 @@ <#return item["./misc"]> -<#function getExportLinks item> - <#return item["./publicationExportLink"]> +<#function hasPlace item> + <#return (item["./place"]?size > 0)> <#function getPlace item> @@ -157,7 +161,7 @@ <#return item["./articles/article"]> -<#function getProceedigingsPapers item> +<#function getProceedingsPapers item> <#return item["./papers/paper"]> diff --git a/ccm-sci-types-project/web/themes/freemarker/ccm-sci-types-project.ftl b/ccm-sci-types-project/web/themes/freemarker/ccm-sci-types-project.ftl index 26fbee832..4fe2a2b05 100644 --- a/ccm-sci-types-project/web/themes/freemarker/ccm-sci-types-project.ftl +++ b/ccm-sci-types-project/web/themes/freemarker/ccm-sci-types-project.ftl @@ -18,18 +18,20 @@ <#function getEnd item> <#if (item["./projectEnd"]?size > 0)> <#return item["./projectEnd"]> - <#elseif (item["./lifeSpan/end"])> + <#elseif (item["./lifeSpan/end"]?size > 0)> <#return item["./lifeSpan/end"]> - <#elseif (item["./nav:attribute[@name = 'projectEnd']"])> + <#elseif (item["./nav:attribute[@name = 'projectEnd']"]?size > 0)> <#return item["./nav:attribute[@name = 'projectEnd']"]> <#function getDescription item> - <#if (item["./projectDesc"])> + <#if (item["./projectDesc"]?size > 0)> <#return item["./projectDesc"]> - <#elseif (item["./description"])> + <#elseif (item["./description"]?size > 0)> <#return item["./description"]> + <#elseif (item["./projectDescription"]?size > 0)> + <#return item["./projectDescription"]>