We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
  • I’ve discovered a "gotcha" in the method of "virtial sites" I use for a multilanguage site. If the page you got sent to (for example, from the News page you click on "Read more...") is set to not show in the menu, you will lose the menu appropriate for the section you are in. The cookie is still valid, and the language menu shows you’re still in the correct language, but you get the default menu. As long as the page is set to show in menu, it works fine.

    Where NewsPublisher comes into this is that by default it disables the show in menu, so in order to use it in a multiple "virtual site" environment, you have to set &showinmenu=1 in the snippet call.
      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
      • 30562
      • 99 Posts
      Hi guys!

      Wished to take an interest:
      1. Is there a russification of snippet News Publisher?
      2. Does its developer support of News Publisher? Links to Wiki from a repository don’t work for some reason. sad
        • 4971
        • 964 Posts
        Susan,can you expand or throw us a link to the "virtual site" method?
          Website: www.mercologia.com
          MODX Revo Tutorials:  www.modxperience.com

          MODX Professional Partner
        • er... that was over two years ago, I think by this I meant that I set up a root-level folder document for each langauge, then arrange the content structure under each one of these.

          Actually, what I do is create the first one, then once the entire "virtual site" structure (for example, all the pages that will be used for the English site) is arranged, then I duplicate the root-level parent/folder document, rename it to Deutsch, for example, and edit all the pages under it for the German site. I use a simple Wayfinder call with the startId of 0, displaying only one level, to generate the langauge menu and style it to have the current language highlighted in some manner.

          I use the FirstChildRedirect snippet on each parent folder/document, but before that I use a simple cookie setting snippet to set a cookie with that parent/folder document’s ID. So each language’s parent/folder document will only have those two snippets in their content. When a user selects a language from the language menu, he’s automatically sent to the first child of that language page, which is the Home page in that language, with a cookie set to that language’s parent ID.

          The cookie value is retrieved at the top of my site templates with another snippet, and that snippet generates placeholders with that ID as well as converts the IDs to appropriate language codes (if my first folder/parent document was 1, then that gets saved in the cookie, gets retrieved in the template and 1 is converted to ’en’). Since it’s placeholders, I can use them all over in the rest of the template or in content for Wayfinder calls, language file includes, etc.
            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