0
votes

I have a template with navigation control with EMPTY datasource in layout detail.

Based on this template, I created a item (A) and updated Nav's datasource in the item's (A) layout detail.

If I create an sub-item (B) under the item (A), is it possible to get its parent's Nav datasource while creating the item automatically? And Nav control's datasource is the same as parent's Nav datasource.

1

1 Answers

0
votes

You will have to write some sort of item:added event for items of that template. There you can get the datasource of the parent through context.Item.Parent.Visualization Sitecore API and set to the current item's visualization object.

This is good reference to events.

This is good reference to consuming Datasource.