Can we access the fields of the Page Types of a page in widget placed in it.

kumar GANJI asked on May 4, 2022 06:31

Hi Team, We are using page builder enabled Page Types and placing widgets. Now we want to access some of the page type placed on which this widget is placed.

Correct Answer

Arjan van Hugten answered on May 4, 2022 07:59

If you want to access the page on which the widget is placed you can use the 'Page' property of the widget properties class as explained in the documentation (https://docs.xperience.io/developing-websites/page-builder-development/developing-widgets#Developingwidgets-Accessingthedataofthecurrentpage.2).

Or you can use the "IPageDataContextRetriever" with the "Retrieve" method to access the page.

1 votesVote for this answer Unmark Correct answer

   Please, sign in to be able to submit a new answer.