Copied to clipboard

Flag this post as spam?

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

  • Bryna 70 posts 235 karma points
    Mar 27, 2019 @ 21:31

    I have a document type which I have created and it is composed with another document type. I am able to display the page name as follows:


    I have tried using the following which I think is equivalent, but nothing is pulled back:


    I have to utilize the second method to utilize the culture parameter for translation. Am I missing something really obvious? The Value method works for the custom properties that I have made on my document type, but I cannot access the page name that way for some reason(versions 8.0 and 8.0.1)

  • AddWeb Solution Pvt. Ltd 109 posts 354 karma points
    Mar 28, 2019 @ 06:00
    AddWeb Solution Pvt. Ltd

    Please use below code its work fine for you.

    @foreach (var (culture, infos) in intlHomePage.Cultures)
        <a href="@intlHomePage.GetUrl(culture)">
            @intlHomePage.Value("title", culture)

    Edit: Where intlHomePage would be the Models Builder class name of your current document type.

    Reference link

  • Bryna 70 posts 235 karma points
    Mar 29, 2019 @ 14:15

    That doesn't return anything. It DOES return something for other properties. I tried using both title and pageTitle[because that is what the Umbraco backoffice UI fills in ]. I have noticed that it will not return Name, Url, or writerName either. Model.Url, Model.Name, and Model.writerName do work.

    Does this mean that Model.FieldName != Model.Value("filedname") with respect to the inherited properties[Ones from PublishedContentWrapped]?

  • Bryna 70 posts 235 karma points
    Apr 05, 2019 @ 15:38

    For anyone who is having a similar problem, this is an answer that solves the issue, although I would still like to know why the more intuitive Model.Value("fieldname", culture: "de") doesn't work.

  • Stephen 767 posts 2272 karma points c-trib
    Apr 06, 2019 @ 16:54

    The "name" of a document is not a property (as in, a user-level property) of that document, hence Value() does not return it. Therefore, the proper way to get the name in another culture is, indeed content.GetCulture("de").Name.

    That being said, it's clumsy, and although I don't think we can get Value() to return it (because, what property alias would we use?), it annoys me that we don't have a simple content.GetName("de") overload.

    Adding this to my list!

  • Bryna 70 posts 235 karma points
    Apr 08, 2019 @ 20:19

    Thank you Stephen. I'm going to mark you as having the answer because I think you addressed the more accurate underlying problem that this is unique to the Name of the page.

    I did manage to get other user level properties to work just fine, albeit with some rather nasty side effects, but those are more design related and not Umbraco:).

  • Tristan Thompson 3 posts 73 karma points c-trib
    Jan 19, 2021 @ 11:07
    Tristan Thompson

    For anyone else who comes here (including my future self!), in newer versions of v8 there's a new extension method to extract the name property:


Please Sign in or register to post replies

Write your reply to: