Copied to clipboard

Flag this post as spam?

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


  • Morten 76 posts 291 karma points
    1 week ago
    Morten
    0

    Namespace name 'Our' not found after installing Vorto

    I am trying to actually use the models properly this time. The last few times I've made Umbraco projects, I've completely ignored the Models Builder and I've removed the model from the inheritage in the templates. This meant I couldn't access properties directly inside of Visual Studio.

    I want to change that now. It worked perfectly before I installed Vorto, so I assume Vorto is the one causing the issues. I get a couple of errors like this:

    The type or namespace name 'Our' could not be found (are you missing a using directive or an assembly reference?)

    The code generated by the Models Builder looks like this (a simple title):

    ///<summary>
    /// Title
    ///</summary>
    [ImplementPropertyType("title")]
    public Our.Umbraco.Vorto.Models.VortoValue Title
    {
        get { return Umbraco.Web.PublishedContentModels.Master.GetTitle(this); }
    }
    

    What could I be doing wrong here? I did include App_Data and App_Plugins in Visual Studio.

    EDIT: Oh and this is my Web.config about ModelsBuilder:

    <add key="Umbraco.ModelsBuilder.Enable" value="true" />
    <add key="Umbraco.ModelsBuilder.ModelsMode" value="AppData" />
    

    I did try PureLive and LiveAppData as well.

  • Morten 76 posts 291 karma points
    7 days ago
    Morten
    100

    Seems like I needed to do:

    Install-Package Our.Umbraco.Vorto
    

    in the Package Manager Console. After doing this, I no longer get errors!

    Now comes the question: How do I access these values? If I do something like:

    <p>@Model.Content.Title</p>
    

    It writes it as Our.Umbraco.Vorto.Models.VortoValue. I've essentially turned Model.Content.GetPropertyValue("title") into Model.Content.Title.

Please Sign in or register to post replies

Write your reply to:

Draft