We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 29181
    • 480 Posts
    Happy New Year!

    ModX has made it into the final 3 of my "find a good allround CMS that I can do everything with and clients can add content to without a week of training" so I decided to have a play with making a simple template. I created boxes around different parts of what I have created and would like to know if there are any pitfalls I might encounter before commencing. Also any comments of making life easier would be super.



    1. This will be the main banner. I will probably make it a number of images, so I can change the image on the right at will when I find something I like more.

    2. Breadcrumbs. Simple as that (hopefully)

    3. Search. The Ajax search looks like just the job for this, maybe I will add a link to the HyperFlex search form too, so people can search in teh old fashioned way. (hopefully reasonibly easy to integrate too)

    4. This would be a simple "textbox" hopefully. I’m hoping to be able to create an English and German version so said content would change depending on version. Not too sure how to place this, presume with CSS on a new layer?

    5. Menu. Pretty much the same as the ModXHost template, so hopefully reasonibly easy to integrate. To the right of furthest right button (in this case contact) I will place an orange to white gradient fill which will scale accordingly depending on the number of buttons.

    6. This is the content part on the right and the news, blog, shoutbox affair on thr right. Copied and pasted this bit from the modx home and I think it will suffice.

    Has anybody had any experience with multi-lingual content, if so tips and tricks would be great smiley

    Any other advice would be appreciated.

    Thanks!
    Taff
      Adrian Lawley: www.adrianlawley.com
      • 16885
      • 255 Posts
      Looks like a neat style, though you might run out of space when you’re getting more pages that you’d like to put in your little navbar. you’re going to use drop downs I guess.

      For 4) you should be able to just position that as a span, p or div, just what you prefer/find more semantic, shouldn’t be much of a problem. Language picking could be done with a snippet or javascript code.

      I don’t have much of an experience with multilingual content, so I’m afraid I can’t help you much with that part wink
        • 28042 ☆ A M B ☆
        • 24,524 Posts
        I set up the document tree for the main language. The parent document is empty except for a FirstChildRedirect snippet; this will cause the user to automatically be sent to the first child, which is the "home" page for the language. Then simply duplicate the top container/document for each language, and edit the content of each language group. Use a single-level menu with the startId as 0 to get the language menu. The main navigation would use the UltimateParent snippet as its startID, so the user would remain inside his chosen "section" unless he chooses another language group from the language menu. This method makes it easy for a client to add more languages if he likes; simply duplicate one of the existing ones and edit the pages.

        You can also use a cookie to specify the language ID (the ID of the language’s parent container/document); use a snippet in the parent document to set the cookie before the FirstChildRedirect snippet call. Then you can get the cookie value with a TV or another snippet, and use that for the startID of the main navigation snippet. This is really only necessary if the user is liable to be going outside of the language section for some reason, such as a commonly used login/logout page or something.

        It is rather simplistic, and the new idea of "contexts" being developed for upcoming versions of MODx will be much more powerful.
          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
          • 29181
          • 480 Posts
          Thank you both for your replies.

          On the subject of "languages packs" for want of a better phrase, that sounds like a simple and effective solution.
          I was thinking of creating a different chunk for each language. Depending which language is currently selected would define which chunk is loaded. I would need to pass this variable on all the time, possibly in a session. This is the approach I took when I created the flash version. I’m a bit more knowledgeable about Flash though, so I think your idea is the best as it can be easily updated.

          Thanks again.

          Taff

          sottwell: On a sidenote, your Blocks template taught me a lot of little tricks with using template variables, so thanks for that too.
            Adrian Lawley: www.adrianlawley.com