Copied to clipboard

Flag this post as spam?

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


  • Naor C 5 posts 84 karma points
    Mar 19, 2024 @ 07:51
    Naor C
    0

    Examples for Element Type vs Document Type

    Hello. I'm new to Umbraco and I was looking for the differences between an Element Type and a Document Type.

    As far as I understand, the difference is mainly that an Element Type has less features than a Document Type. However, I can't find any examples that can help me decide which type I want to use.

    Specifically in my project - my idea is to have one screen that would contain several "exercises" that I want to do.

    So I was thinking about making 2 objects:

    1. "Headings & icons" object: This object would contain the data that will be shared among all pages, no matter the user. It would include all the headings and all the icons that the page needs.
    2. "Exercise" object: I want the content manager to add all the exercises that a user can have, so this object would include the relevant data.

    Now I'm curious whether should I use Element Type or Document Type. Both of the objects are repeating a set of properties so they fit the Element Type. But the Document Type definition is "Creating a Document Type (without a template) is about defining the content structure and fields that can be used across different content items" and I can't really get to the point of what that means.

    It would really help me if anyone can give me examples of using Document Type and Element Type, or recommend me how to build my Umbraco models correctly. Thanks in advance.

  • Nik 1595 posts 7154 karma points MVP 6x c-trib
    Mar 19, 2024 @ 10:28
    Nik
    100

    Hi Naor,

    Document Types represent pages in your content tree, so if you want to be able to create it as a page in your site or a page in your content tree then it must be a document type.

    Element Types are used to define types that are using it Block List / Block Grid - they cannot be created independently but instead are used to make up properties. (https://docs.umbraco.com/umbraco-cms/fundamentals/data/defining-content/default-document-types#element-type)

    Thanks,

    Nik

  • Naor C 5 posts 84 karma points
    Mar 20, 2024 @ 07:28
    Naor C
    0

    Thank you very much, Nik. It was hard for me at first to dive into this project I'm working on, but now the differences are clear to me.

Please Sign in or register to post replies

Write your reply to:

Draft