We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 17895
    • 209 Posts
    A small demo you can find in http://www.mindreamz.net/modx091/ but I would like the MODx-gurus to look at my code to know if I used the right functions in the right places (going into the core code to find out which function to use is not a great thing, maybe sometimes I used a deprecated function or something like this)

    The goal was to provide a multi-language-content site, in which the user can choose a preferred language and browse the site reading pages in that language if they are available, and been redirected to a "default language page" if not.

    My solution is the following:
    1) there is a $_SESSION variable that stores the preferred language choice of the user;
    2) I modified the *_site_content table adding two fields:
    - contentLang, that stores something like "en", "it", "fr", ...
    - refId, the id of the page in the default language which this one is a translation
    3) I added a snippet to show the language flags for the user choice
    4) I added a plug-in that redirects to the right-language page
    5) I modified the DropMenu to show only the chosen language entries
    6) I modified the manager in these ways:
    - in the document tree, each page has next to it its current translations (you can click on them and go to the translation, without the need to have a different tree for each language and to have not every page translated)
    - while vieweing a document, you can also see in which language is the content and you have a button that duplicates the page to begin to translate it
    - in the settings page you have to write which languages your site is in and the default language

    The only thing that is to be implemented is a plug-in that rebuilds the tree accordingly after the insertion of a new translation (it is needed and you can easily figure out why)

    Now, then, how can I show my solution? I can give to someone the access to my manager, in order to see my modifies. Or... what else?
      Daniele "MadMage" Calisi
      • 32241
      • 1,495 Posts
      That’s so cool. I saw it already, and it’s nice!

      Hope I can have the right to access the demo version of it, if you wouldn;t mind. FYI, I’m not a core developer for MODx and I’m not a PHP or programmer guru, hope it doesn’t bother you.

      Great job in implementing that, that looks awesome. Hope it can be implemented later as the core system, by the time all the core developer agree to that, and willing to make an aoverhaul backend for MODx.

      Btw madmage, you know the backend already, so do you think its going to be hard in implementing sub site capability of MODx?

      Sincerely,
        Wendy Novianto
        [font=Verdana]PT DJAMOER Technology Media
        [font=Verdana]Xituz Media
        • 17895
        • 209 Posts
        Isn’t it already implemented? I read a message in which someone develop a snippet to do this... Am I missing something?
          Daniele "MadMage" Calisi
          • 32241
          • 1,495 Posts
          yeah, it’s being implemented, but it won’t work the way you want it with alias path. Let’s assume that you have a folders for subsites, and each folder will have its own alias, lets call it subsite1, subsite2, and etc. Then for each subsite will have this alias being appended as alias. So the address will look like this, http://www.domain.com/subsite1/home.htm.

          I just want the ability to remove the subsite1 path for each domain, without the need to use it. Do you have any thought of this?

          Thanks
            Wendy Novianto
            [font=Verdana]PT DJAMOER Technology Media
            [font=Verdana]Xituz Media
            • 6726
            • 7,075 Posts
            I very much like the underlying logic, if this can be made into a snippet we could have real multilingual content for MODx which would be yet another strong point for us grin

            Very nice, can’t wait to have our coding team look into this and help you turn this into a proof of concept solution for multi-lingual content... thanks !
              .: COO - Commerce Guys - Community Driven Innovation :.


              MODx est l'outil id
              • 17895
              • 209 Posts
              mod_rewrite?

              RewriteRule ^([^\/]*)\/(.*)$ http://www.yourwebsite.com/$2 [L]

              or I haven’t understood your problem?
                Daniele "MadMage" Calisi
                • 17895
                • 209 Posts
                Quote from: davidm at Dec 26, 2005, 04:49 PM

                I very much like the underlying logic, if this can be made into a snippet we could have real multilingual content for MODx which would be yet another strong point for us grin

                Very nice, can’t wait to have our coding team look into this and help you turn this into a proof of concept solution for multi-lingual content... thanks !

                I hope to succeed in having a contact with some core coder... it seems hard in these days... smiley
                  Daniele "MadMage" Calisi
                  • 17895
                  • 209 Posts
                  Quote from: madmage at Dec 27, 2005, 06:55 AM

                  mod_rewrite?

                  RewriteRule ^([^\/])*\/(.*)$ http://www.yourwebsite.com/$2 [L]

                  or I haven’t understood your problem?

                  this is better (remember that it have to be in the modx installation root directory):

                  RewriteRule ^[^\/]*\/(.*)$ /$1 [L]
                    Daniele "MadMage" Calisi
                    • 6726
                    • 7,075 Posts
                    Quote from: madmage at Dec 27, 2005, 06:56 AM
                    I hope to succeed in having a contact with some core coder... it seems hard in these days... smiley

                    Yeah well it’s only normal given the holidays. I’ve no doubt they’ll get in touch pretty soon, few ideas are lost around here, that’s one of the strength of this community smiley

                    Thanks for the login/pass for the demo : VERY NICE ! The way you integrated this into the backend is simply great and I wish to see it as one of the bundled plugin. Plus I wouldn’t mind having this kind of marketing ammo smiley Few CMS have this implemented, often it’s a workaround or a hack to implement multilanguage.

                    Really impressive work !
                      .: COO - Commerce Guys - Community Driven Innovation :.


                      MODx est l'outil id
                      • 32963
                      • 1,732 Posts
                      Quote from: madmage at Dec 27, 2005, 06:56 AM

                      I hope to succeed in having a contact with some core coder... it seems hard in these days... smiley

                      Well it’s the holiday season so you know...

                      Very nice work on the multi-language content implementation smiley

                      We will certainly look into what you have done and see how it can be added to the new core.

                      PS. where possible it ’s best to use plugins to handle your changes. There are events that you can use to overwrite most of the core.

                      Many thanks and happy holidays!

                        xWisdom
                        www.xwisdomhtml.com
                        The fear of the Lord is the beginning of wisdom:
                        MODx Co-Founder - Create and do more with less.