Copied to clipboard

Flag this post as spam?

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


  • claudio morandi 23 posts 91 karma points
    Jul 12, 2017 @ 15:09
    claudio morandi
    0

    Error on adding new property to document type (uSiteBuilder)

    Hello all I'm new to Umbraco and Vega uSiteBuilder. I'd like to know how to add a new property to an existing document type. I actually added a new property of type "ContentPicker" to the document type class, but running the project is goes into an "object reference not set to an instance of an object" error on runtime. Can anyone help me please?

  • Alex Skrypnyk 6175 posts 24186 karma points MVP 8x admin c-trib
    Jul 20, 2017 @ 10:45
    Alex Skrypnyk
    0

    Hi Claudio

    What version of Umbraco are you using?

    uSiteBuilder isn't working with latest Umbraco.

    Thanks,

    Alex

  • claudio morandi 23 posts 91 karma points
    Jul 20, 2017 @ 11:48
    claudio morandi
    0

    uhm Umbraco 7.6.4 uSiteBuilder works partially, so I had to add the contentpicker directly inside the administration of umbraco while I can keep the textstring properties inside the code. Is there some other way to create a document type in code-first mode?

  • Dave Woestenborghs 3504 posts 12135 karma points MVP 9x admin c-trib
    Jul 20, 2017 @ 12:19
    Dave Woestenborghs
    4

    Hi Claudio,

    My suggestion is to ditch uSiteBuilder. I has been proven time after time that there is no Code First framework that works correctly with Umbraco.

    If you want strongly typed models this is already supported by Umbraco Models builder which was introduced in 7.4

    I wrote an article about getting started with Models builder : https://24days.in/umbraco-cms/2016/getting-started-with-modelsbuilder/

    If you are using uSiteBuilder for having your doctypes generated on deploy to another environment have a look at uSync This tool saves all configuration to xml files that you can deploy to another environment and can be imported there.

    Also in my opinion using the doctype editor let's me create doctypes much faster than coding c# classes and decorating the properties with attributes.

    Here are some articles on why code first should not be used : https://www.zpqrtbnk.net/posts/codefirst-post-mortem https://offroadcode.com/journal/news/the-code-first-in-umbraco-deadend/

    Here are also some video's from the legendary Pete Duncanson explaining why code first is a bad thing : UK Fest 14 : https://www.youtube.com/watch?v=Hr1irQ0h5J8 uHangout : http://uhangout.co.uk/videos/ep032-with-pete-duncanson-the-ugly-chat-about-code-first-frameworks/

    Dave

  • claudio morandi 23 posts 91 karma points
    Jul 20, 2017 @ 16:10
    claudio morandi
    0

    Thank you very much Dave, I'll read those articles and try to use your approach

Please Sign in or register to post replies

Write your reply to:

Draft