Copied to clipboard

Flag this post as spam?

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


  • Kenneth Truyers 1 post 21 karma points
    Oct 19, 2013 @ 01:25
    Kenneth Truyers
    0

    Grouping data types into a new datatype

    Hi all, 

     

    I've been trying to do something which I think should be really simple, and it probably is, but I can't seem to find the right way to do it.

    I need to provide the same three properties on different document types. Let's say for example the following (myModule):

    ModuleTitle => textstring
    ModuleDescription => textstring
    Visible => true / false

    I have been trying to create some sort of grouped datatype that could group these three together, so that I can add all three of them to a page, by just adding a property of datatype "myModule".

    I have looked into the following extensions:

    http://our.umbraco.org/projects/backoffice-extensions/embedded-content
    http://ucomponents.org/ (DataTypeGrid)

    These almost do what I'm after, except for the fact that they allow you to group datatypes and then the content editor can add multiple rows. I don't want that, I want them to just have these three available.

    I also looked into the fieldset extension, but that's only for visually grouping them on the edit page. You still have to add them one by one.

    Am I going the wrong about this? It just seems like a very trivial thing to do, but I can't figure it out.

  • Funka! 398 posts 661 karma points
    Oct 19, 2013 @ 07:04
    Funka!
    1

    Document Type inheritance would do what you're asking. You'd have a "ModuleBase" document type, then any other document types that you wanted to have these properties too, you could have them inherit from this base. No packages required, just standard umbraco behavior.

    If this is not practical, such as you have different needs for inheritance structure or your site is already built-out, may I recommend checking out the DocTypeMixins plugin. This may be just what you're looking for.

    Good luck!

  • Charles Afford 1163 posts 1709 karma points
    Oct 19, 2013 @ 21:04
    Charles Afford
    0

    Yea doc type inhertance is what you need.

    All properties inherit from the top down

    So doc type right at the bottom will inherit any properties on any doc types above it.  Charlie :)

Please Sign in or register to post replies

Write your reply to:

Draft