I am setting up a multilingual site using template variables to house the foreign language content for each resource. For example, on the ’Homepage’ resource, there are Spanish template variables that mirror the English field variables (title, content, etc) with a ’spanish_’ prefix, creating content in two languages housed in one resource. I feel that this configuration provides the most intuitive means to update content for our users, more than different resources/children for each page in each language or different contexts for each language.
If an admin user wants to update the Spanish homepage, they click on the ’Homepage’ resource, move to the template variables tab (possibly to be renamed ’other languages’) and edit. This also allows the page content of each language to be directly connected, giving admin users the ability to create a new page with all language options available by default and not having to create one resource or child for English and another for Spanish, etc. I do not want our admin users to have to ever worry about child/parent relationships. General users will need to navigate from an English page to the corresponding Spanish page in one click, so there must be a solid database relationship between the two.
I have attempted to setup a plug-in that runs on the OnWebPageInit event that alters the $modx->documentMethod, but as I understand it, $modx->documentMethod is determined before any events can be called. My original thought was that dependent upon the language preference stored in a session variable, $modx->documentMethod would change (say ’alias’, ’spanish_alias’, with the ’spanish_’ tacked on by php that runs before documentMethod is specified).
Any other ideas on how to accomplish this? I do not want to directly modify an MODx code.
-
☆ A M B ☆
- 24,524 Posts
If you are using Evo, you might want to check out YAMS, which does just that and a lot more.
http://modxcms.com/extras/package/?package=543
We are using Revolution 2.0.3