x First time here? Check out the FAQ

Come work for Umbraco - The Umbraco HQ are hiring Project managers, .NET developers and DevOps people!

  • Avatar74posts235karma

    GetProperty

    K.Garrein started this topic March 11, 2011 @ 12:51

    Hey,

    I have a multilingual site.

    I have 3 properties in a document type:
    1. Content_NL
    2. Content_FR
    3. Content_EN

    Now I wish to get the language-specific Content.
    I tried the following, but it doesn't do the trick :)

    @{ string lang = "NL"; }
    @item.GetProperty( "Content_" + lang ).Value

    How do I get the Content_XX property that I need?

    Thank you.
    Kris.


  • Avatar74posts235karma
    Comment with ID: 68898
    K.Garrein posted this reply March 11, 2011 @ 01:15

    Maybe I shouldn't post so fast :)

    This does the trick:

    @{ string lang = "NL"; }
    @item.Properties["Titel_" + lang]


    Regards.
    K.


  • Sebastiaan Janssen posted this reply March 11, 2011 @ 05:07

    What didn't work in the first case? I've just ran the code and it gives me a perfect result!


Please login or Sign up To post replies