Copied to clipboard

Flag this post as spam?

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


  • Tony Groome 261 posts 804 karma points
    Jan 05, 2015 @ 14:44
    Tony Groome
    0

    display "Enter a name..."

    Hi All

    In my Content editor, when I create a new (in my case) NewsItem, I can then "Enter a name..." . How can I access this name in the settings section? I need to display it on my webpage.

    Thanks.

    Tony 

  • Dennis Aaen 4500 posts 18255 karma points admin hq c-trib
    Jan 05, 2015 @ 15:15
    Dennis Aaen
    100

    Hi Tony,

    The name that you enter in the "enter name" field when you create a new news item, is the node name of the page.

    So you can get this in Razor if you are in dynamic Razor you can do

    @CurrentPage.Name 

    If you are in strongly typed context, then you need.

    @Model.Content.GetPropertyValue("Name") 

    or which will gives you the same

    @Model.Content.GetPropertyValue<string>("Name") 

    Hope I have understood your question correctly.

    /Dennis

  • Tony Groome 261 posts 804 karma points
    Jan 05, 2015 @ 15:17
    Tony Groome
    0

    Hi Dennis

    Spot on! That's exactly it. Thanks you saved my bacon!

    Tony :)

  • Dennis Aaen 4500 posts 18255 karma points admin hq c-trib
    Jan 05, 2015 @ 15:25
    Dennis Aaen
    1

    Hi Tony

    You´re welcome, glad that I could help you :-)

    /Dennis

Please Sign in or register to post replies

Write your reply to:

Draft