0

On the page item I have added Tabs composite component and on the tab item added Hero component and data source set from page data folder like page:Data/hero

I am running logic on publish end event, where I am accessing the page's renderings. In this event, the context item is null, so first I set the context item to the page for which publish end event happened and then accessed rendering from the page item.

Once page-level rendering is accessed, to access further rendering from tab component I set the context item to an individual tab item and accessed tab item level rendering

The logic is used pageItem.Visualization.GetRenderings(device,false)

But with the above logic, everything works fine but above-mentioned hero component which is added on tab item and data source is from page data folder, the data source path is formed from tabitem1 data folder and not the page's data folder, so not able to resolve hero rendering's data source item.

Is there any way to access composite rendering with it's datasource? which contains "page:" as datasource?

1 Answer 1

0

Tab component is a composite component. It maintains its presentation differently. Your hero component's data source would not be present at path page:Data/hero. Rather it would be created at tab-datasoruce-item/tab1:Data/hero. You need to track that datasource item via page item's tab component's datasource item.

Just to get more idea, please read below link.

What are Composite Renderings/Components in SXA

Hope this helps.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.