Copied to clipboard

Flag this post as spam?

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


  • blackhawk 313 posts 1368 karma points
    Dec 01, 2017 @ 20:02
    blackhawk
    0

    How to get rich text editor content with Models Builder

    How do we retrieve content that is based on the rich text property editor with Models Builder?

    • I have a document type called Home, and inside of it I have a rich text editor with a property alias name of sSOBar.

    • I have a Home template (which is a child of my Master template). The Home template has the following code:

    ...

     @inherits Umbraco.Web.Mvc.UmbracoViewPage<ContentModels.Home>
        @using ContentModels = Umbraco.Web.PublishedContentModels;
        @{
            Layout = "Master.cshtml";
        }
    
        <p>my content value for SSOBar is : @Model.SSOBar</p>
    

    But when I run this, I get a compile error message stating:

    Compiler Error Message: CS1061: 'Umbraco.Web.PublishedContentModels.Home' does not contain a definition for 'SSOBar' and no extension method 'SSOBar' accepting a first argument of type 'Umbraco.Web.PublishedContentModels.Home' could be found (are you missing a using directive or an assembly reference?)

    What am I missing?

    Yet this works...

    @Umbraco.Field("sSoBar")
    

    Thanks for any help on this with Models Builder

  • blackhawk 313 posts 1368 karma points
    Dec 01, 2017 @ 21:06
    blackhawk
    0

    I think I have it all working now, although I don't know if this was just a limitation in being in PureLive mode or not...

    From my web.config I switched from PureLive to DLL mode, re-generated, and now Visual Studio picks up the intellisense and allows me to build my project without error. In addition, there are no compile errors and I can see my values on page.

  • Alex Skrypnyk 6163 posts 24143 karma points MVP 8x admin c-trib
    Dec 02, 2017 @ 11:38
    Alex Skrypnyk
    101

    Hi Blachhawk

    It can be a problem of local IIS or IIS Express, it's not working with PureLive models, Dll mode is working everywhere.

    Thanks,

    Alex

  • blackhawk 313 posts 1368 karma points
    Dec 02, 2017 @ 13:08
    blackhawk
    0

    ahhh - Thanks for that tip!

Please Sign in or register to post replies

Write your reply to:

Draft