diff --git a/applications/content/webapp/content/website/WebSiteCMSContent.ftl b/applications/content/webapp/content/website/WebSiteCMSContent.ftl index b09e787105..83c57a017d 100644 --- a/applications/content/webapp/content/website/WebSiteCMSContent.ftl +++ b/applications/content/webapp/content/website/WebSiteCMSContent.ftl @@ -164,7 +164,6 @@
<#if (content?has_content)> - <#list requestParameters.keySet() as paramName> @@ -176,11 +175,19 @@ + + <#if (dataResourceTypeId != 'IMAGE_OBJECT' && dataResourceTypeId != 'OTHER_OBJECT' && dataResourceTypeId != 'LOCAL_FILE' && + dataResourceTypeId != 'OFBIZ_FILE' && dataResourceTypeId != 'VIDEO_OBJECT' && dataResourceTypeId != 'AUDIO_OBJECT')> <#if (dataResourceTypeId != 'NONE')> + <#if (dataResourceTypeId == 'IMAGE_OBJECT' || dataResourceTypeId == 'OTHER_OBJECT' || dataResourceTypeId == 'LOCAL_FILE' || + dataResourceTypeId == 'OFBIZ_FILE' || dataResourceTypeId == 'VIDEO_OBJECT' || dataResourceTypeId == 'AUDIO_OBJECT')> + + <#else> + @@ -331,10 +338,11 @@ <#-- this all depends on the dataResourceTypeId which was selected --> - <#if (dataResourceTypeId == 'IMAGE_OBJECT' || dataResourceTypeId == 'OTHER_OBJECT' || - dataResourceTypeId == 'VIDEO_OBJECT' || dataResourceTypeId == 'AUDIO_OBJECT')> + <#if (dataResourceTypeId == 'IMAGE_OBJECT' || dataResourceTypeId == 'OTHER_OBJECT' || dataResourceTypeId == 'LOCAL_FILE' || + dataResourceTypeId == 'OFBIZ_FILE' || dataResourceTypeId == 'VIDEO_OBJECT' || dataResourceTypeId == 'AUDIO_OBJECT')> - + + <#if ((content.contentId)?has_content)> <@renderContentAsText contentId="${content.contentId}" ignoreTemplate="true"/> diff --git a/applications/content/webapp/content/website/WebSiteCMSNav.ftl b/applications/content/webapp/content/website/WebSiteCMSNav.ftl index fc9b1c9479..68335d18c9 100644 --- a/applications/content/webapp/content/website/WebSiteCMSNav.ftl +++ b/applications/content/webapp/content/website/WebSiteCMSNav.ftl @@ -46,84 +46,87 @@ } <#-- creating the JSON Data --> +<#macro fillTreeSubsites assocList> + <#if (assocList?has_content)> + <#list assocList as assoc> + <#assign content = assoc.getRelatedOne("ToContent")/> + { + "data": {"title" : cutNameLength("${content.contentName!assoc.contentIdTo}"), "attr": {"href": "javascript:void(0);", "onClick" : "callDocument('', '${assoc.contentIdTo}', jQuery('#${assoc.contentIdTo}'), '');"}}, + + <#assign assocChilds = content.getRelated("FromContentAssoc")?if_exists/> + "attr": {"id" : "${assoc.contentIdTo}", "contentId" : "${assoc.contentId}", "fromDate" : "${assoc.fromDate}", "contentAssocTypeId" : "${assoc.contentAssocTypeId}"} + <#if assocChilds?has_content> + ,"children": [ + <@fillTreeSubsites assocList = assocChilds/> + ] + + <#if assoc_has_next> + }, + <#else> + } + + + + +<#macro fillTreeMenus assocList> + <#if (assocList?has_content)> + <#list assocList as assoc> + <#assign content = assoc.getRelatedOne("ToContent")/> + { + "data": {"title" : cutNameLength("${content.contentName!assoc.contentIdTo}"), "attr": {"href": "javascript:void(0);", "onClick" : "callDocument('${assoc.contentIdTo}');"}}, + <#assign assocChilds = content.getRelated("FromContentAssoc")?if_exists/> + "attr": {"id" : "${assoc.contentIdTo}", "contentId" : "${assoc.contentId}", "fromDate" : "${assoc.fromDate}"} + <#if assocChilds?has_content> + ,"children": [ + <@fillTreeMenus assocList = assocChilds/> + ] + + <#if assoc_has_next> + }, + <#else> + } + + + + + +<#macro fillTreeError assocList> + <#if (assocList?has_content)> + <#list assocList as assoc> + <#assign content = assoc.getRelatedOne("ToContent")/> + { + "data": {"title" : cutNameLength("${content.contentName!assoc.contentIdTo}"), "attr": {"href": "javascript:void(0);", "onClick" : "callDocument('', '${assoc.contentIdTo}', '', '');"}}, + <#assign assocChilds = content.getRelated("FromContentAssoc")?if_exists/> + "attr": {"id" : "${assoc.contentIdTo}", "contentId" : "${assoc.contentId}", "fromDate" : "${assoc.fromDate}"} + <#if assocChilds?has_content> + ,"children": [ + <@fillTreeError assocList = assocChilds/> + ] + + <#if assoc_has_next> + }, + <#else> + } + + + + + var rawdata_subsites = [ <#if (subsites?has_content)> - <@fillTree assocList = subsites/> - <#macro fillTree assocList> - <#if (assocList?has_content)> - <#list assocList as assoc> - <#assign content = assoc.getRelatedOne("ToContent")/> - { - "data": {"title" : cutNameLength("${content.contentName!assoc.contentIdTo}"), "attr": {"href": "javascript:void(0);", "onClick" : "callDocument('', '${assoc.contentIdTo}', '', '');"}}, - <#assign assocChilds = content.getRelated("FromContentAssoc")?if_exists/> - "attr": {"id" : "${assoc.contentIdTo}", "contentId" : "${assoc.contentId}", "fromDate" : "${assoc.fromDate}"} - <#if assocChilds?has_content> - ,"children": [ - <@fillTree assocList = assocChilds/> - ] - - <#if assoc_has_next> - }, - <#else> - } - - - - + <@fillTreeSubsites assocList = subsites/> ]; var rawdata_menus = [ <#if (menus?has_content)> - <@fillTree assocList = menus/> - <#macro fillTree assocList> - <#if (assocList?has_content)> - <#list assocList as assoc> - <#assign content = assoc.getRelatedOne("ToContent")/> - { - "data": {"title" : cutNameLength("${content.contentName!assoc.contentIdTo}"), "attr": {"href": "javascript:void(0);", "onClick" : "callDocument('${assoc.contentIdTo}');"}}, - <#assign assocChilds = content.getRelated("FromContentAssoc")?if_exists/> - "attr": {"id" : "${assoc.contentIdTo}", "contentId" : "${assoc.contentId}", "fromDate" : "${assoc.fromDate}"} - <#if assocChilds?has_content> - ,"children": [ - <@fillTree assocList = assocChilds/> - ] - - <#if assoc_has_next> - }, - <#else> - } - - - - + <@fillTreeMenus assocList = menus/> ]; var rawdata_errors = [ <#if (errors?has_content)> - <@fillTree assocList = errors/> - <#macro fillTree assocList> - <#if (assocList?has_content)> - <#list assocList as assoc> - <#assign content = assoc.getRelatedOne("ToContent")/> - { - "data": {"title" : cutNameLength("${content.contentName!assoc.contentIdTo}"), "attr": {"href": "javascript:void(0);", "onClick" : "callDocument('', '${assoc.contentIdTo}', '', '');"}}, - <#assign assocChilds = content.getRelated("FromContentAssoc")?if_exists/> - "attr": {"id" : "${assoc.contentIdTo}", "contentId" : "${assoc.contentId}", "fromDate" : "${assoc.fromDate}"} - <#if assocChilds?has_content> - ,"children": [ - <@fillTree assocList = assocChilds/> - ] - - <#if assoc_has_next> - }, - <#else> - } - - - - + <@fillTreeError assocList = errors/> ]; @@ -343,6 +346,11 @@ var rawdata_errors = [ if (contentId != null && contentId.length) { ctx['contentId'] = contentId; } + if (objstr) { + ctx['contentIdFrom'] = objstr.attr('contentid'); + ctx['fromDate'] = objstr.attr('fromdate'); + ctx['contentAssocTypeId'] = objstr.attr('contentassoctypeid'); + } } //jQuerry Ajax Request diff --git a/applications/content/widget/WebSiteScreens.xml b/applications/content/widget/WebSiteScreens.xml index bf934f0501..0cf748d0a1 100644 --- a/applications/content/widget/WebSiteScreens.xml +++ b/applications/content/widget/WebSiteScreens.xml @@ -219,12 +219,16 @@ under the License. - - - - - - + + + + + + + + + +