Copied to clipboard

Flag this post as spam?

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


  • Kim Bantz Rasmussen 81 posts 310 karma points
    Oct 22, 2015 @ 12:33
    Kim Bantz Rasmussen
    0

    NuPickers - Custom Labels in multi langual site

    Hi,

    I am having trouble finding the correct culture in my custom label view of an unpublished node (when I create a new node).

    My goal is to only show the editor only the list of nodes with a document type of SidebarTeaser under the current domain. I have two websites in my Umbraco, one english and the other german.

    @inherits Umbraco.Web.Macros.PartialViewMacroPage
    
    @{
    var id = Model.MacroParameters["key"].ToString();
        var currentNode = Umbraco.TypedContent(id);
    if (currentNode != null)
    {
        var currentHome = currentNode.Ancestor(1).Children.First(x => x.DocumentTypeAlias == "Frontpage");
        var currentCulture = currentHome.GetCulture();
        if (Model.Content.AncestorOrSelf(1).GetCulture().LCID == currentCulture.LCID)
        {
            <div>
                @currentNode.Name
            </div>
        }
    }
    
    }
    

    Is there another way to find the culture?

    Best regards Kim

Please Sign in or register to post replies

Write your reply to:

Draft