Copied to clipboard

Flag this post as spam?

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


  • Andy 13 posts 54 karma points
    Apr 03, 2020 @ 10:15
    Andy
    0

    Models builder and generating doucument types from code tutorial?

    Hi guys,

    Im using umbraco 8 and trying to get my head around building document types from code, much like you would do episerver.

    googling has lead me to models builder but I can't seem to find a clear and concise explanation of how to use it. Is anyone aware of a straightforward tutorial or some docs that are actually step by step / in depth? slightly frustrating as a lot of content is either out dated or not containing enough info

    Thanks!

  • Nik 1617 posts 7263 karma points MVP 7x c-trib
    Apr 03, 2020 @ 10:36
    Nik
    0

    Hi Andy,

    So, there is no easy way to build document types from code in v8 as far as I'm aware. Models Builder is a tool for creating Classes from you DocTypes but not the other way around.

    You'd have to write your own processing mechanism that interacts with the core Umbraco Services, such as DocumentTypeService to start doing something like that.

    If that is something you want to do, it could be worth looking at the source code for uSync which does document type updates / creation based on config files (which are exported from other instances). Might help.

    Thanks

    Nik

  • David Brendel 792 posts 2970 karma points MVP 3x c-trib
    Apr 03, 2020 @ 11:26
    David Brendel
    0

    Hi Andy,

    as Nik said you don't have the same way of generating stuff like in episerver. You have to create them in the backoffice.

    ModelsBuilder generates classes for use in your views.

    Usync can by used to sync environments and changes to your system. It stores all Data in xml Files that can be checked in to source control and deployed.

Please Sign in or register to post replies

Write your reply to:

Draft