Switch languages

4 posts by 2 authors in: Forums > CMS Builder
Last Post: December 8, 2009   (RSS)

Re: [Dan Maitland] Switch languages

By ross - December 8, 2009

Hi Dan

Thanks for posting!

Because there are several ways to setup CMS Builder for using multiple languages, we should go over how you have yours setup.

From experience, I find it works best if you only have one record for each item you create but it has several fields on it for all the different languages.

Could you let me know if this is how you have it set up too? If not, how do you have it setup?

Thanks!
-----------------------------------------------------------
Cheers,
Ross Fairbairn - Consulting
consulting@interactivetools.com

Hire me! Save time by getting our experts to help with your project.
Template changes, advanced features, full integration, whatever you
need. Whether you need one hour or fifty, get it done fast with
Priority Consulting: http://www.interactivetools.com/consulting/

Re: [ross] Switch languages

Yes this is how I have it set up. ! post and fields for each language.

Re: [Dan Maitland] Switch languages

By ross - December 8, 2009

Hi Dan

Great!

The next step is going to be making several copies of your display template like this:

displayPageEnglish.php
displayPageFrench.php
displayPageSpanish.php

You can use any name you like as long as you know which one is which. Of course, on those pages, you would display the appropriate pages for each language.

To link between the templates but still keep the same record displaying, you can use something like this:

<a href="displayPageEnglish.php?num=<?php echo $record['num']; ?>">English</a>

<a href="displayPageFrench.php?num=<?php echo $record['num']; ?>">French</a>

<a href="displayPageSpanish.php?num=<?php echo $record['num']; ?>">Spanish</a>

Do you see how that works? You are basically just linking to the different pages but using the same record number each time. You'll need to make sure you change "$record" so it matches your page.

Give it a shot and let me know how you make out :).

Thanks!
-----------------------------------------------------------
Cheers,
Ross Fairbairn - Consulting
consulting@interactivetools.com

Hire me! Save time by getting our experts to help with your project.
Template changes, advanced features, full integration, whatever you
need. Whether you need one hour or fifty, get it done fast with
Priority Consulting: http://www.interactivetools.com/consulting/