0
votes

I followed this tutorial to assign different languages to a website (I have Umbraco 7.3), so I have now two pages: www.vcfm.mx and www.vcfm.mx/us/, but the navigation menu for both sites is still in spanish.

Is there a way to create a new main menu and assign it to the /us site? or, is there any way to change the language of the menu items in the /us page?

Thank you very much for your help!

EDIT: this was the tutorial I refered: http://carlosmartinezt.com/2014/06/umbraco-7-and-mvc-multilanguage/

1
What tutorial? Can you show the navigation code?Jannik Anker
sorry @JannikAnker, I updated the post with the tutorial I followed :)yenssen
You should have created these as 2 top level nodes (i.e. www.vcfm.mx & www.vcfm.com OR www.vcfm.us) and then you could have set the Culture on the hostname per site. I think the issue is that it is picking up the former culture that you have for the site you copied from.Craig Mayers

1 Answers

0
votes

It depends how your existing navigation works, but I assume its similar to:

@foreach(var page in Model.Content.AncestorOrSelf(1).Children)
{
    <li>@page.Name</li>
}

If so, you will need to determine which root element to use. I would personally not use the URL to determine the root node but the following should do the trick.

@foreach(var page in Model.Content.AncestorsOrSelf(1).Last(p=> Model.Content.Url.StartsWith(p.Url)).Children)
{
    <li>@page.Name</li>
}

Rather than looking for a single Ancestor at the first level the second snippet looks up any root level nodes and selects the last one that matches the current URL.

Unable to test the code.