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

SOLVED

textfield value from parent page

Avatar

Level 6

Hi Team,

 

I have Page component for that i have added one text field for basic tab  i.e SITE NAME

 

  I have created multiple level child  pages based on above page component. when ever i edit child page properties i am able to see SITE NAME test field if i enter SITE NAME=abc.com its comming in page property lke SITE-name=abc.com if i leave empty i am not able to see SITE_NAME property in pages.

 

Now  the requirement is i will not enter the SITE NAME for child pages but its parent page contains SITE Name  how i will get parent page site name  child page. 

 

 

 

1 Accepted Solution

Avatar

Correct answer by
Community Advisor
2 Replies

Avatar

Level 5

Did following way not work?

 

Page currentPage = request.getResource().adaptTo(Page.class);

Page parentPage = currentPage.getParent();

String siteName = parentPage.getProperties().get("SITE-name",String.class);

Avatar

Correct answer by
Community Advisor