[K13 MVC] Get PageBuilderDataContext (Or pageIdentifier) for a from Component used as a widget prope

Bob Haring asked on January 5, 2023 07:17

Currently I'm working on a form component that will be used as a widget property in the Page Builder scenario. This form component needs to have information of the current page it's on. I assumed that the Dependency Injected IPageBuilderDataContextRetriever object would contain the Configuration of a page (pageBuilderDataContext.Retrieve().Configuration) but instead I'm getting the following error: Required property 'pageIdentifier' not found in JSON. Path '', line 1, position 1.

So it appears that a form component is unable to know information of a page where it's being used on. Is there a way to retrieve this information? Or just find out the id of the page so I can retrieve it myself? In Portal Engine for example I was able to use macro's to pass data to a formField regarding the current page it's on.

Recent Answers


Elmar Höfinghoff answered on January 6, 2023 09:50

Have you tried IPageDataContextRetriever.Retrieve<TreeNode>().Page() ?

0 votesVote for this answer Mark as a Correct answer

Jacob Mohr answered on January 6, 2023 11:27

For example, when developing a widget displaying links to a set of pages, a property of the widget could use the page selector form component to enable editors to choose the pages.

0 votesVote for this answer Mark as a Correct answer

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