We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 19315
    • 84 Posts
    Hi,

    I’ve created a multi-lingual site, using a method similar to the one I found in http://wiki.modxcms.com/index.php/Make_Multi_Lingual_Site. However, my document tree is slightly different. Instead of each language having its own sub directory/folder, the main language (in this case English) is in the root of the site, and the other languages (in my case just Polish for now) have their own subfolder. (Much like apple.com actually, not that I’m styling my site after them...). E.g.

    Root
    | -> English Home (site start) (1)
    | -> English Page About Something (2)
         | -> English Sub Page About Something (3)
    | -> English Contact Info (4)
    | -> Polish Home (5)
         | -> Polish Page About Something (6)
              | -> Polish Sub Page About Something (7)
         |-> Polish Contact Info (8)
    


    Now for the menus. For both of the English and Polish pages, I would like the "Home" to appear in the lists at the same level as the rest of the language content, i.e. on English Pages, the menu to look like
    Home (link to site root)
    About Something (link to 2)
    | -> Sub page about something (link to 3)
    Contact Info (link to 4).

    And the Polish pages to look exactly the same (but for the Polish content)
    Home (link to 5)
    About Something (link to 6)
    | -> Sub page about something (link to 7)
    Contact Info (link to 8).


    The tricky thing is the fact that the Polish Home is at a different level to the Polish content, but I would like the "Home" link to be at the same level in the menu. This seems to be easy for the English pages, as (1) The English Home *is* at the same level to the English Pages content-wise and (2) The Wayfinder snippet automatically points links to the document that is the site_start to the site root. However, I can’t figure out a way to do it for the Polish pages.

    Any suggestions?

    Michal.
      • 19315
      • 84 Posts
      Ah: I’ve got it! I feared some dodgy-ness was necessary, but I can do it with a TV and A weblink. I change my document tree to be:

      Root
      | -> English Home (site start) (1)
      | -> English Page About Something (2)
           | -> English Sub Page About Something (3)
      | -> English Contact Info (4)
      | -> Polish Home (not shown in Menu) (5)
           | -> Polish Home (Weblink to 5)
           | -> Polish Page About Something (6)
                | -> Polish Sub Page About Something (7)
           |-> Polish Contact Info (8)
      

      i.e. Made Polish Home not shown in the menu, and added a weblink to the Polish Home within Polish home itself.

      I then make a TV called "languageHome" that contains the id of the language root, and set the default to @INHERIT 0, but set it on Polish Home (Document 5) to 5. Thus all the English pages have it set to 1, but the Polish pages have it set to 5. In the call to Wayfinder I set the startId as startId=`[*languageHome*]`. That’s it!

      Michal.

      Edit: Changed to "@INHERIT 0". Somehow @INHERIT 1as the start ID didn’t work on the English pages, but I’m not sure why.
        • 28042 ☆ A M B ☆
        • 24,524 Posts
        Because document #1 has no children, so there won’t be any output with that as the startId.
          Studying MODX in the desert - http://sottwell.com
          Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
          Join the Slack Community - http://modx.org
          • 19315
          • 84 Posts
          Quote from: sottwell at Apr 15, 2008, 06:01 AM

          Because document #1 has no children, so there won’t be any output with that as the startId.
          Thanks!

          Michal.
            • 11235
            • 16 Posts
            THANK! YOU! <3
              • 18374
              • 69 Posts
              Great idea, thanks!