Wednesday, 10 February 2016

How to get current page path in AEM

How to get the current page path in AEM.

In AEM all the data are stored in the form of nodes.
Sometimes it becomes important to get the path of the page node for performing various operations like storing data under the page node.

This can easily be done from a component JSP file by using the implicit "currentPage" object as shown below.

<%@include file="/libs/foundation/global.jsp"%>
<%@page session="false" %>


Drag and drop this component to a authorable page. This will print the current page path in the rendered HTML page.

No comments:

Post a Comment

Coder Magnet
CoderMagnet is full of resources from our daily development activities. It has solutions for common problematic scenarios in technologies like Java 8, AEM, JCR and also occasionally gives you tips on Blogger as well.