Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Jeremy Coulson 61 posts 143 karma points
    Mar 01, 2018 @ 21:32
    Jeremy Coulson
    0

    How can I make a document type get inherited by other document types?

    Hello!

    In Umbraco, I see on some of our document types that settings are inherited from other document types elsewhere under the "Document Types" tree. For example under "Document Types -> Common -> Compositions", I see a "Grid Content" type that is inherited by document types in other folders. I created a new type called "Project Information" under "Document Types -> Common -> Compositions". How can I make this document type get inherited by other types just like the "Grid Content" type is inherited by other types?

    Thanks in advance!

    Jeremy

  • Anders Bjerner 487 posts 2989 karma points MVP 7x admin c-trib
    Mar 01, 2018 @ 21:54
    Anders Bjerner
    0

    Hi Jeremy,

    I've tried to illustrate it with a few screenshots.

    When editing a document type, you can click the Composition link, which in return will open a new panel where you can select one or more other document types that should be used for composition/inheritance.

    The examples below are based on the default starter kit, that ships with Umbraco. Here is a document type called Blog, for which Content Base and Navigation Base are used as compositions. Blog will then inherit tabs and properties from both these document types.

    Hope that answers your question ;)

    image

    image

  • Jeremy Coulson 61 posts 143 karma points
    Mar 01, 2018 @ 22:02
    Jeremy Coulson
    0

    Awesome! This works for some of our types. For others, I see the message: "This content type is used in a composition, and therefore cannot be composed itself." Is there a way around this?

    Thanks!

  • Anders Bjerner 487 posts 2989 karma points MVP 7x admin c-trib
    Mar 01, 2018 @ 22:13
    Anders Bjerner
    0

    I think this is because that document type has a child document type - in which case you won't be able to add a composition.

    For instance in my test solution, I've created a Hest document type, along with a child document type called Test. You won't be able to add any compositions to Hest, but you will be able to add compositions for Test.

    You could think of it as something that only available for leaf document types.

    image

  • Jeremy Coulson 61 posts 143 karma points
    Mar 02, 2018 @ 13:37
    Jeremy Coulson
    0

    Okay, that makes sense.

    This type has properties that it says are inherited from other compositions. I guess that it was possible to do that because the types under this one were created after this one.

    Is that probably correct?

Please Sign in or register to post replies

Write your reply to:

Draft