When to use inherited Doc Types?
# help-with-umbraco
t
Hi I noticed when creating document types they could be created individually, so if I created the below document types -Customers -Customer They would sit at the same level. If I created my document types like -Customers --Customer Where customer is a child of customers (by this it means I right click Customers document type and then add a new document type called Customer). Why would I use one over technique over the other or is there no difference? As we also have compositions which could be used in similar ways?
m
The decendant doc type inheirts all of the properties from the parent this can be useful if you know they will always want to match up, and you want to disguise Blogs from Case studies for the editor and querying it also lets you add properties to the children that are extras
As you rightly pointed out now we have compositions, which before v8(iirc) we didnt have this option, I personally and I know others do avoid nesting doc types as they are tightly coupled unlike compostions
m
I never use inheritance, it always ended bad for me. +1 for compositions
a
This for me too 😄
k
Me three. Never again inherit. We used to inherit (even in v8) for the sort-of obvious use-case of making all page doctypes inherit from a layout doctype, where the layout doctype had properties like "hide from navigation" etc. But it broke several upgrades, didn't play well with uSync etc. I'm sure it could work (i.e., it was our fault), but we won't try again 🙂
35 Views