<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How to display page properties of  2 level up page in Adobe Experience Manager Questions</title>
    <link>https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/how-to-display-page-properties-of-2-level-up-page/m-p/538904#M133856</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;LI-USER uid="17493101"&gt;&lt;/LI-USER&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;You can achieve this requirement with the help of &lt;A href="https://experienceleague.adobe.com/docs/experience-manager-htl/using/htl/global-objects.html?lang=en" target="_blank" rel="noopener"&gt;HTL Global Objects&lt;/A&gt;&amp;nbsp;in Sightly.&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;Sightly Code :&lt;/EM&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;SPAN&gt;2&lt;/SPAN&gt;nd Level Page Path : ${currentPage.parent.parent.path} &amp;lt;/br&amp;gt;&lt;BR /&gt;&lt;SPAN&gt;2&lt;/SPAN&gt;nd Level Custom Page Properties : ${currentPage.parent.parent.properties[&lt;SPAN&gt;'countryName'&lt;/SPAN&gt;]} &amp;lt;/br&amp;gt;&lt;BR /&gt;&lt;SPAN&gt;2&lt;/SPAN&gt;nd Level Page Title : ${currentPage.parent.parent.properties[&lt;SPAN&gt;'jcr:title'&lt;/SPAN&gt;]} &amp;lt;/br&amp;gt;&lt;BR /&gt;&lt;SPAN&gt;1&lt;/SPAN&gt;st Level Page Title : ${currentPage.parent.properties[&lt;SPAN&gt;'jcr:title'&lt;/SPAN&gt;]} &amp;lt;/br&amp;gt;&lt;BR /&gt;&lt;SPAN&gt;0 &lt;/SPAN&gt;Level or Current Page Title :  ${currentPage.properties[&lt;SPAN&gt;'jcr:title'&lt;/SPAN&gt;]} &amp;lt;/br&amp;gt;&lt;BR /&gt;Or : ${pageProperties[&lt;SPAN&gt;'jcr:title'&lt;/SPAN&gt;]} &amp;lt;/br&amp;gt;&lt;BR /&gt;Or : ${currentPage.title}&lt;/PRE&gt;
&lt;P&gt;&lt;EM&gt;&amp;nbsp;Component Sceenshot :&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Test Page.jpg" style="width: 999px;"&gt;&lt;img src="https://experienceleaguecommunities.adobe.com/t5/image/serverpage/image-id/46012iAB727E372980446F/image-size/large/is-moderation-mode/true?v=v2&amp;amp;px=999" role="button" title="Test Page.jpg" alt="Test Page.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Hope this could help you !!!&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Shiv&lt;/P&gt;</description>
    <pubDate>Wed, 03 Aug 2022 00:18:18 GMT</pubDate>
    <dc:creator>Shiv_Prakash_Patel</dc:creator>
    <dc:date>2022-08-03T00:18:18Z</dc:date>
    <item>
      <title>How to display page properties of  2 level up page</title>
      <link>https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/how-to-display-page-properties-of-2-level-up-page/m-p/538842#M133849</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;
&lt;P&gt;I have requirement to display parent page properties in the child page which is 2 level up&lt;/P&gt;
&lt;P&gt;example:homepage-&amp;gt;page1-&amp;gt;page2&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; here i need to display properties of homepage in the page2 page&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;anyone work on this requirement.&lt;/P&gt;</description>
      <pubDate>Tue, 02 Aug 2022 17:21:29 GMT</pubDate>
      <guid>https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/how-to-display-page-properties-of-2-level-up-page/m-p/538842#M133849</guid>
      <dc:creator>bangar20</dc:creator>
      <dc:date>2022-08-02T17:21:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to display page properties of  2 level up page</title>
      <link>https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/how-to-display-page-properties-of-2-level-up-page/m-p/538851#M133851</link>
      <description>&lt;P&gt;Hi &lt;LI-USER uid="17493101"&gt;&lt;/LI-USER&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can use Sling Model to get the parent Page object, and then use the page API from sightly to obtain such values.&lt;/P&gt;
&lt;P&gt;Using constructor injection as the example below as this strategy&amp;nbsp;&lt;SPAN&gt;can also reduce memory consumption of your application,&amp;nbsp;&lt;A href="https://sourcedcode.com/blog/aem/aem-sling-model-field-injection-vs-constructor-injection-memory-consumption" target="_blank" rel="noopener nofollow noreferrer"&gt;https://sourcedcode.com/blog/aem/aem-sling-model-field-injection-vs-constructor-injection-memory-con...&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Sightly:&lt;/STRONG&gt;&lt;/P&gt;
&lt;PRE&gt;&amp;lt;sly data-sly-use.mycomponent="com.mysite.models.components.MyComponent"&amp;gt;&amp;lt;/sly&amp;gt;
${mycomponent.properties['jcr:title']}&lt;/PRE&gt;
&lt;P&gt;&lt;STRONG&gt;Sling Model:&lt;/STRONG&gt;&lt;/P&gt;
&lt;PRE&gt;import com.day.cq.wcm.api.Page;
import org.apache.sling.api.resource.Resource;
import org.apache.sling.models.annotations.DefaultInjectionStrategy;
import org.apache.sling.models.annotations.Model;
import org.apache.sling.models.annotations.injectorspecific.ScriptVariable;

import javax.inject.Inject;
import javax.inject.Named;

@Model(adaptables = Resource.class,
	defaultInjectionStrategy = DefaultInjectionStrategy.OPTIONAL)
public class MyComponent {

	private Page absParentPage;

	@Inject
	public MyComponent(@ScriptVariable @Named("currentPage") final Page currentPage) {
		Page parentPage = currentPage.getAbsoluteParent(2);
		if (parentPage != null) {
			absParentPage = parentPage;
		}
	}

	public Page getAbsParentPage() {
		return absParentPage;
	}
}&lt;/PRE&gt;
&lt;P&gt;Hope that helps!&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Santosh&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 02 Aug 2022 17:56:31 GMT</pubDate>
      <guid>https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/how-to-display-page-properties-of-2-level-up-page/m-p/538851#M133851</guid>
      <dc:creator>SantoshSai</dc:creator>
      <dc:date>2022-08-02T17:56:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to display page properties of  2 level up page</title>
      <link>https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/how-to-display-page-properties-of-2-level-up-page/m-p/538904#M133856</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;LI-USER uid="17493101"&gt;&lt;/LI-USER&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;You can achieve this requirement with the help of &lt;A href="https://experienceleague.adobe.com/docs/experience-manager-htl/using/htl/global-objects.html?lang=en" target="_blank" rel="noopener"&gt;HTL Global Objects&lt;/A&gt;&amp;nbsp;in Sightly.&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;Sightly Code :&lt;/EM&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;SPAN&gt;2&lt;/SPAN&gt;nd Level Page Path : ${currentPage.parent.parent.path} &amp;lt;/br&amp;gt;&lt;BR /&gt;&lt;SPAN&gt;2&lt;/SPAN&gt;nd Level Custom Page Properties : ${currentPage.parent.parent.properties[&lt;SPAN&gt;'countryName'&lt;/SPAN&gt;]} &amp;lt;/br&amp;gt;&lt;BR /&gt;&lt;SPAN&gt;2&lt;/SPAN&gt;nd Level Page Title : ${currentPage.parent.parent.properties[&lt;SPAN&gt;'jcr:title'&lt;/SPAN&gt;]} &amp;lt;/br&amp;gt;&lt;BR /&gt;&lt;SPAN&gt;1&lt;/SPAN&gt;st Level Page Title : ${currentPage.parent.properties[&lt;SPAN&gt;'jcr:title'&lt;/SPAN&gt;]} &amp;lt;/br&amp;gt;&lt;BR /&gt;&lt;SPAN&gt;0 &lt;/SPAN&gt;Level or Current Page Title :  ${currentPage.properties[&lt;SPAN&gt;'jcr:title'&lt;/SPAN&gt;]} &amp;lt;/br&amp;gt;&lt;BR /&gt;Or : ${pageProperties[&lt;SPAN&gt;'jcr:title'&lt;/SPAN&gt;]} &amp;lt;/br&amp;gt;&lt;BR /&gt;Or : ${currentPage.title}&lt;/PRE&gt;
&lt;P&gt;&lt;EM&gt;&amp;nbsp;Component Sceenshot :&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Test Page.jpg" style="width: 999px;"&gt;&lt;img src="https://experienceleaguecommunities.adobe.com/t5/image/serverpage/image-id/46012iAB727E372980446F/image-size/large/is-moderation-mode/true?v=v2&amp;amp;px=999" role="button" title="Test Page.jpg" alt="Test Page.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Hope this could help you !!!&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Shiv&lt;/P&gt;</description>
      <pubDate>Wed, 03 Aug 2022 00:18:18 GMT</pubDate>
      <guid>https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/how-to-display-page-properties-of-2-level-up-page/m-p/538904#M133856</guid>
      <dc:creator>Shiv_Prakash_Patel</dc:creator>
      <dc:date>2022-08-03T00:18:18Z</dc:date>
    </item>
  </channel>
</rss>

