Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

[AEM Gems Webinar] Accelerating Experience Manager as a Cloud Service development with Rapid Development Environments

How to read inheritedPageProperties in sling models?


Level 3

I would like to show the boolean values in my showIcon property based on the text in my title property. 


I added below code in my local to read inherited page properties but it didn't work. 

textModel.showIcon is showing false even though when I author "some text" words in extitle dialog

My HTL code:


<div class="test">
<svg aria-hidden="true" class="test-icon -test-team"
data-sly-test="${inheritedPageProperties.Icon || textModel.showIcon}">
<span class="test-copy-text">

 My sling model code:




private InheritanceValueMap pageProperties;

private Page currenPage;

public boolean isShowIcon() {
return showIcon;

protected void init() {
InheritanceValueMap ivm = new HierarchyNodeInheritanceValueMap(currenPage.getContentResource());
String inheritedValueCustomProperty = ivm.getInherited("extitle", String.class);

if(inheritedValueCustomProperty !=null){
if(inheritedValueCustomProperty.contains("some text"))
showIcon = true;






Sling model 


public boolean isShowIcon() {
return showIcon;

private boolean showIcon;

if(pageProperties !=null){
String copyrightText1 = pageProperties.get( "extitle", "" );
if(copyrightText1.contains("some text"))
showIcon = true;


1 Accepted Solution


Correct answer by
Level 4
0 Replies


Correct answer by
Level 4


Community Advisor


your code looks alright, no problems here. Can you share with us your page structure?