<#-- Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -->
<#-- Do this so that we don't have to find the content twice (again in renderSubContent) --> <#assign subContentId=requestParameters.contentId!/> <#assign nodeTrailCsv=requestParameters.nodeTrailCsv!/> <#-- <#assign dummy=Static["org.apache.ofbiz.base.util.Debug"] .logInfo("in viewcontent, nodeTrailCsv:" + nodeTrailCsv, "")/> --> <#if ancestorList?has_content && (0 < ancestorList?size) > <#assign lastContent=ancestorList?last /> <#assign firstContent=ancestorList[0] /> <#if firstContent?has_content> <#assign siteId = firstContent.contentId/> <#if siteId?has_content> <@renderAncestryPath trail=ancestorList?default([]) endIndexOffset=1 siteId=siteId/> <#if lastContent?has_content>

[${lastContent.contentId}] ${lastContent.description!}

<#-- <#assign globalNodeTrail=[]/> <#assign firstContentId=""/> <#if nodeTrailCsv?has_content> <#assign globalNodeTrail=Static["org.apache.ofbiz.base.util.StringUtil"].split(nodeTrailCsv, ",") /> <#if 0 < globalNodeTrail?size> <#assign firstContentId=globalNodeTrail[0]?string/> <#assign globalNodeTrail=requestParameters.globalNodeTrail?default([])/> --> <#if globalNodeTrail?has_content && (0 < globalNodeTrail?size) > <#assign lastNode = globalNodeTrail?last/> <#if lastNode?has_content> <#assign subContent=lastNode.value/> <#else> <#assign subContent = delegator.findOne("Content", Static["org.apache.ofbiz.base.util.UtilMisc"].toMap("contentId", subContentId), true)/> <#assign dummy=Static["org.apache.ofbiz.base.util.Debug"] .logInfo("in viewcontent, subContent:" + subContent, "")/>

${uiLabelMap.EcommerceContentFor} [${subContentId}] ${subContent.contentName!} - ${subContent.description!}:


<#assign thisContentId = subContentId/> <@loopSubContent contentId=thisContentId viewIndex=0 viewSize=9999 contentAssocTypeId="RELATED_CONTENT"> <#assign thisNodeTrailCsv = nodeTrailCsv />
  <@renderSubContentCache subContentId=subContentId /> <#-- <@wrapSubContentCache subContentId=subContentId wrapTemplateId="WRAP_VIEW" > <@checkPermission mode="equals" entityOperation="_CREATE" targetOperation="HAS_USER_ROLE" > Respond -->
${content.contentName!}

<#-- <@checkPermission mode="not-equals" subContentId=subContentId targetOperation="CONTENT_CREATE|CONTENT_RESPOND" contentPurposeList="RESPONSE" > ${permissionErrorMsg!} -->
<#macro renderAncestryPath trail siteId startIndex=0 endIndexOffset=0 buttonTitle="Back to" searchOn="" > <#local indent = ""> <#local csv = ""> <#local counter = 0> <#local len = trail?size> <#list trail as content> <#if counter < (len - endIndexOffset) && startIndex <= counter > <#if 0 < counter > <#local csv = csv + ","/> <#local csv = csv + content.contentId/> <#if counter < len && startIndex <= counter > <#local counter = counter + 1> <#if 20 < counter > <#break/>
${indent} <#if content.contentTypeId == "WEB_SITE_PUB_PT" > ${uiLabelMap.CommonBackTo}  ${content.contentName!} <#else> ${uiLabelMap.CommonBackTo}  ${content.contentName!} <#local indent = indent + "    "> [${content.contentId!}] <#if searchOn?has_content && searchOn?lower_case == "true">   ${uiLabelMap.CommonSearch}