Copied to clipboard

Flag this post as spam?

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


  • emaadali 56 posts 96 karma points
    Sep 23, 2013 @ 20:46
    emaadali
    0

    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.

  • [email protected] 406 posts 2135 karma points MVP 7x c-trib
    Sep 23, 2013 @ 21:32
    jeffrey@umarketingsuite.com
    0

    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

  • emaadali 56 posts 96 karma points
    Sep 23, 2013 @ 22:47
    emaadali
    0

    @{
       
            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.

  • Yannick Smits 321 posts 718 karma points
    Sep 23, 2013 @ 22:58
    Yannick Smits
    0

    should work with this package as you described. Did you "relate nodes on copy"?

  • emaadali 56 posts 96 karma points
    Sep 24, 2013 @ 11:11
    emaadali
    0

    Yes it will work with this package. No I don't. It give me error when i related it.

  • emaadali 56 posts 96 karma points
    Sep 24, 2013 @ 11:12
    emaadali
    0

    Yes it will work with this package. No I don't. It give me error when i related it.

  • emaadali 56 posts 96 karma points
    Sep 24, 2013 @ 11:12
    emaadali
    0

    Yes it will work with this package.

    No I don't.

    It give me error when i related it.

  • Yannick Smits 321 posts 718 karma points
    Sep 24, 2013 @ 11:18
    Yannick Smits
    0

    What error did you get? You need to fix that before this package will work.

  • emaadali 56 posts 96 karma points
    Sep 24, 2013 @ 11:19
    emaadali
    0

    It gives me error that you have similar nodes in multiple locations. So I stop digging and write my own code.

Please Sign in or register to post replies

Write your reply to:

Draft