0
votes

I have a document type called Web Page and a document type called elements. The elements doc type holds all the different layouts eg, cards, banners, carousels, etc the page doc type has the default common elements for a page.

What I want to is when adding the page doc type in the content section that the elements doc type is automatically attached as a sub object to the page.

The idea is to make the user experience a lot less cluttered.

Has anybody go a solution or can point me in the right direction

2

2 Answers

0
votes

take a look at the events section of the Umbraco Documentation: https://our.umbraco.com/documentation/Reference/Events/ContentService-Events

You can attach your own handle to the published event, check if it is a brand new node, and trigger an automatic publish of a child node of 'elements' type.

0
votes

This sounds like something that might be better accomplished with either the Grid or Nested/Stacked Content maybe?

That way you can have all of the elements on the page they actually belong to. The nice thing about stacked content (and the grid) is that you can get it to render a preview, so the user can see how the element will look when published.

The main issue I've had with sub-pages with elements in is that once you have content several levels deep it can be a pain to keep track of the layout sub-nodes, and they can also be accidentally removed by the editors, causing issues.