Copied to clipboard

Flag this post as spam?

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


  • Paul Seal 443 posts 2413 karma points MVP 3x c-trib
    5 days ago
    Paul Seal
    0

    How do I get IPublishedContent intellisense to work in the views

    Hi I'm building a site in Umbraco 9 and I am struggling because I don't have the usual intellisense for IPublishedContent.

    Please can you tell me how I get intellisense to work.

    I want to be able to do @Model. and see the available properties etc

    Kind regards

    Paul

  • Bjarke Berg 14 posts 82 karma points hq
    5 days ago
    Bjarke Berg
    0

    Hi Paul..

    What Models Builder mode are you running? If it is PureLive, it is not expected that you can see the properties from the model in the IDE.

    If you run AppData mode, you need to include the files in the project. And then you should have IntelliSense

    enter image description here

  • Paul Seal 443 posts 2413 karma points MVP 3x c-trib
    5 days ago
    Paul Seal
    0

    Ok I will try that, thanks.

    How do I change the models builder mode with the appSettings.json?

  • Bjarke Berg 14 posts 82 karma points hq
    5 days ago
  • Paul Seal 443 posts 2413 karma points MVP 3x c-trib
    5 days ago
    Paul Seal
    0

    Thanks but where are the files in the solution that I need to include please? It’s not obvious to me.

  • Bjarke Berg 14 posts 82 karma points hq
    5 days ago
    Bjarke Berg
    0

    Sorry :)

    The default path is /umbraco/models But that can be changed on the in the settings too, using the key ModelsDirectory

    {
      "Umbraco": {
        "CMS": {
          "ModelsBuilder": {
            "ModelsMode": "AppData",
            "ModelsDirectory": "/whatever/path/"
          }
        }
      }
    }
    
  • Andrew 12 posts 92 karma points
    1 day ago
    Andrew
    0

    I've been simply including the files in umbraco/models and setting them to compile. I saw this post and tried setting ModelsDirectory.

    I seem to get an error no matter what I put in ModelsDirectory.

    Even when I try "ModelsDirectory": "/umbraco/models/" or "ModelsDirectory": "/umbraco/models"

    ConfigurationException: Invalid models directory "/umbraco/models/".

    Umbraco.Extensions.ModelsBuilderConfigExtensions.GetModelsDirectory(string root, string config, bool acceptUnsafe)

    Does the directory need to be a sub-directory of something specific?

  • Paul Seal 443 posts 2413 karma points MVP 3x c-trib
    5 days ago
    Paul Seal
    0

    That has done the trick, thank you

Please Sign in or register to post replies

Write your reply to:

Draft