You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by dk...@apache.org on 2018/05/10 05:48:37 UTC

[sling-whiteboard] 02/04: Updating to support listing items without a jcr:title set

This is an automated email from the ASF dual-hosted git repository.

dklco pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-whiteboard.git

commit 4309dc221d731a65164785011d0c25f0d30822bf
Author: Dan Klco <dk...@apache.org>
AuthorDate: Wed May 9 23:47:11 2018 -0600

    Updating to support listing items without a jcr:title set
---
 .../sling-cms/components/cms/contentnav/contentnav.jsp    | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

diff --git a/cms/ui/src/main/resources/jcr_root/libs/sling-cms/components/cms/contentnav/contentnav.jsp b/cms/ui/src/main/resources/jcr_root/libs/sling-cms/components/cms/contentnav/contentnav.jsp
index 4ba37a0..d306ac4 100644
--- a/cms/ui/src/main/resources/jcr_root/libs/sling-cms/components/cms/contentnav/contentnav.jsp
+++ b/cms/ui/src/main/resources/jcr_root/libs/sling-cms/components/cms/contentnav/contentnav.jsp
@@ -28,12 +28,23 @@
 					<c:when test="${sling:getRelativeResource(item,'jcr:content') != null}">
 						<sling:encode value="${sling:getRelativeResource(item,'jcr:content').valueMap['jcr:title']}" mode="HTML" />
 					</c:when>
-					<c:otherwise>
+					<c:when test="${not empty item.valueMap['jcr:title']}">
 						<sling:encode value="${item.valueMap['jcr:title']}" mode="HTML" />
+					</c:when>
+					<c:otherwise>
+						<sling:encode value="${item.name}" mode="HTML" />
 					</c:otherwise>
 				</c:choose>
 			</a>
 		</li>
 	</c:forEach>
-<li class="Nav-Item"><a href="${properties.createPath}" title="Create a new ${not empty properties.createTitle ? properties.createTitle : properties.title}" class="Fetch-Modal" data-title="Create ${not empty properties.createTitle ? properties.createTitle : properties.title}" data-path=".Main-Content form">+ ${not empty properties.createTitle ? properties.createTitle : properties.title}</a></li>
+	<c:choose>
+		<c:when test="${not empty properties.createTitle}">
+			<c:set var="createTitle" value="${properties.createTitle}" />
+		</c:when>
+		<c:otherwise>
+			<c:set var="createTitle" value="${properties.title}" />
+		</c:otherwise>		
+	</c:choose>
+	<li class="Nav-Item"><a href="${properties.createPath}" title="Create a new ${createTitle}" class="Fetch-Modal" data-title="Create ${createTitle}" data-path=".Main-Content form">+ ${createTitle}</a></li>
 </ul>
\ No newline at end of file

-- 
To stop receiving notification emails like this one, please contact
dklco@apache.org.