Copied to clipboard

Flag this post as spam?

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


  • Tom 161 posts 322 karma points
    Mar 16, 2015 @ 19:22
    Tom
    0

    Intellisense

    I ahve installed UmbracoCMS v7.2 with start kit using VS 2012 (as VS2013 has bug where you can't debug @helper with VS2013).

    As I am making way around the code, I am puzzled about something.

    What do I need to do to get intellisens in the backoffice and in Visual Studio (*.cshtml) files?


    As for me I don't get either?

     

    Thanks


    Tom

  • Dennis Aaen 4500 posts 18255 karma points admin hq c-trib
    Mar 16, 2015 @ 19:30
    Dennis Aaen
    0

    Hi Tom,

    To get intellisense in Visual Studio for your (*.cshtml) files. You need to use the strongly typed Razor. When you using the @CurrentPage you are using the dynamic Razor. So dynamic Razor is conciseness where with strongly typed Razor you will get the intellisense. To get the current page in strongly tyed Razor you need to write. Model.Content.

    As you can see here there https://our.umbraco.org/documentation/using-umbraco/backoffice-overview/property-editors/Built-in-Property-Editors-v7/Content-Picker is two examples on how to get data from the content picker in Umbraco 7. To get the intellisense in Visual Studio you need to use the strongly typed example like this.

    @{ 
        if (Model.Content.HasValue("contentPicker")){
            var node = Umbraco.TypedContent(Model.Content.GetPropertyValue<int>("contentPicker"));
            <a href="@node.Url">@node.Name</a>
        }
    }

    Hope this helps,

    /Dennis

  • Tom 161 posts 322 karma points
    Mar 18, 2015 @ 13:35
    Tom
    0

    Dennis: 

    Thanks for replying.

    OK if @CurrentPage is dynamic and I can't get intellisense in my .cshtml page, how do I go about getting a list of what's avaialble?

     

    Thanks


    Tom

  • Dennis Aaen 4500 posts 18255 karma points admin hq c-trib
    Mar 18, 2015 @ 19:20
    Dennis Aaen
    0

    Hi Tom,

    To get a list of what standard Umbraco fields, that´s avaialble, try to see this video Umbraco.TV

    http://umbraco.tv/videos/umbraco-v7/implementor/fundamentals/templating/setting-up-our-first-template/ You can see the whole video if you want to, but for to answer you question try to see from 3 min 25 sec.

    For getting data of of standard field, e.g the when the document is created then use @CurrentPage.createDate.

    For your custom properties, use @CurrentPage.propertyAlias. And there is also a list https://our.umbraco.org/documentation/using-umbraco/backoffice-overview/property-editors/Built-in-Property-Editors-v7 of the built in properties, with examples on how to get data from it, in both strongly typed Razor or dynamic Razor.

    Hope this helps, and don't hesitate to ask again

    /Dennis

  • Tom 161 posts 322 karma points
    Mar 19, 2015 @ 11:51
    Tom
    0

    Dennis:

    Forgive me for asking again, but I take it there isn't a documentation similar to what Microsoft does with its documentation -->where it lists methods/properties for each object plus its parent object?

  • Dennis Aaen 4500 posts 18255 karma points admin hq c-trib
    Mar 19, 2015 @ 13:49
    Dennis Aaen
    0

    Hi Tom,

    I have not seen such documentation like this myself unfortunately. Perhaps, some other members of the community knows if such of information is available.

    /Dennis

  • Tim 1193 posts 2675 karma points MVP 4x c-trib
    Mar 19, 2015 @ 15:25
    Tim
    0

    Hi Tom,

    There are some cheat sheets available here that list a lot of the available properties and methods: https://our.umbraco.org/projects/developer-tools/umbraco-v6-mvc-razor-cheatsheets

    :)

  • Dennis Aaen 4500 posts 18255 karma points admin hq c-trib
    Mar 19, 2015 @ 15:33
    Dennis Aaen
    1

    I totally forgot the Razor cheat sheets : -)

    /Dennis

Please Sign in or register to post replies

Write your reply to:

Draft