开发者

CMS for "multilingual" site?

i am developing a site that needs to have American and UK versions with mostly identical content. the differences in language are minor so i'm not looking for translation software. ideals i'm aiming for something that has two text fields per post. one for the US text and one for the UK text. there needs to be a fairly large gallery for book characters and when i add an entry it would be ideal to just type in the first country's entry then copy and paste the 2nd country's into the 2nd text field and change some words (math to maths, for instance). this would save me a lot of time 开发者_开发技巧and make future updates much simpler.

is there anything out there that has any features similar to this or will i need to create my own from a framework such as codeigniter or MODx?

thanks for reading, and i appreciate any help with this issue.


You could use the regular document variables (pagetitle, content, etc.) for the primary language and template variables in MODx for the secondary. Set a session variable for the user's choice at runtime and then make a plugin that executes when the page is parsed to insert the appropriate fields in your document. It'll take a good understanding how MODx templates work with placeholders.

Something like this in your plugin:

if ($_SESSION['userlang'] == 'en-us'){
  $content = $modx->documentObject['content'];
} else {
  $tv = $modx->getTemplateVarOutput('ukContent');
  $content = $tv['ukContent'];
}
$modx->setPlaceholder('content', $content);
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜