I have an situation regarding using multi switcher.
I have got 4 languages. English, Italian, French and Denish. All four languages have there own hostnames and all contains same name nodes like register, products, etc
I want if user on en language and he is seeing products page. If he click on IT,FR,DE he directly visit the same page.
At the moment when user click on IT,FR,DE he go first to its homepage of desire clicked language and then user need to click on page link again..
I want user viewing a page on any language if he select any other language he directly go to that page of clicked language.
Please let me know how to do it.
Let me know if you still don't understand my question.
you have to do some coding yourself. First of all; did you copy the original site to the other languages? And if so, did you tick the checkbox "Relate copied items to original". If you did that, there's a relationship between the pages that you copied and the original. In that way you can connect each of the pages easilier together by using the relation API (http://our.umbraco.org/Documentation/Reference/Management/Relations/relation).
Otherwise you've to look at your setup if the document type is unique in some way. For example if there's only one page of documenttype "A", and you click on another language, you can search for the page in that installation that is from the documenttype "A".
Same node in multiple sites under one umbraco instance
Hi,
I have an situation regarding using multi switcher.
I have got 4 languages. English, Italian, French and Denish. All four languages have there own hostnames and all contains same name nodes like register, products, etc
I want if user on en language and he is seeing products page. If he click on IT,FR,DE he directly visit the same page.
At the moment when user click on IT,FR,DE he go first to its homepage of desire clicked language and then user need to click on page link again..
I want user viewing a page on any language if he select any other language he directly go to that page of clicked language.
Please let me know how to do it.
Let me know if you still don't understand my question.
Regards.
Hi emaadali,
you have to do some coding yourself. First of all; did you copy the original site to the other languages? And if so, did you tick the checkbox "Relate copied items to original". If you did that, there's a relationship between the pages that you copied and the original. In that way you can connect each of the pages easilier together by using the relation API (http://our.umbraco.org/Documentation/Reference/Management/Relations/relation).
Otherwise you've to look at your setup if the document type is unique in some way. For example if there's only one page of documenttype "A", and you click on another language, you can search for the page in that installation that is from the documenttype "A".
Hope this points you in the right direction.
If not, let me know!
Jeffrey
@{
int total = MultiLanguage.Functions.GetUrlsAndLanguages(Model.Id).Count;
int counter = 0;
<ul style="list-style-type: none;font-size:17px;padding-top: 8px;">
@try
{ if (total > 1)
{
foreach (var data in MultiLanguage.Functions.GetUrlsAndLanguages(Model.Id))
{
counter += 1;
if (string.IsNullOrEmpty(data.Url))
{
if(@data.LanguageCode == "fr")
{
<li style="display: inline;text-transform: uppercase;"><u>@data.LanguageCode</u> </li>
}
else
{
<li style="display: inline;text-transform: uppercase;"><u>@data.LanguageCode</u> <span style="padding:5px"> | </span> </li>
}
}
else
{
string[] strAllNodes = Model.Path.Split(',');
if(strAllNodes.Length > 3)
{
string nodeUrl = data.Url+"/";
for(int i = 3; i < strAllNodes.Length; i++)
{
nodeUrl = nodeUrl + Model.NodeById(int.Parse(strAllNodes[i])).Name.Replace(" ","-")+"/";
}
<li style="display: inline;text-transform: uppercase"><a href="@nodeUrl.ToLower()">@data.LanguageCode</a>
@if(counter < total)
{ <span style="padding:5px"> | </span> }
</li>
}
else
{
<li style="display: inline;text-transform: uppercase"><a href="@data.Url">@data.LanguageCode</a>
@if(counter < total)
{ <span style="padding:5px"> | </span> }
</li>
}
}
}
}
}
catch (Exception ex)
{
Response.Write("Error: " + ex.Message + " Model.Id: " + Model.Id);
}
</ul>
}
I have done it :) Please read code properly. Everything done in there.
should work with this package as you described. Did you "relate nodes on copy"?
Yes it will work with this package. No I don't. It give me error when i related it.
Yes it will work with this package. No I don't. It give me error when i related it.
Yes it will work with this package.
No I don't.
It give me error when i related it.
What error did you get? You need to fix that before this package will work.
It gives me error that you have similar nodes in multiple locations. So I stop digging and write my own code.
is working on a reply...