Hello, sorry for my poor english but i really need help to solve a little problem : explanations :
I have to build a site with two languages : french and english. My idea is to create for each article a template variable just below (text area with tinyMCE) for the version in the other language; in that way the two version are in the same doc.
If i want the the english version (’cause i’m french), i juste have to call in the template my TVs [*content-english*] and [*pagetitle-english*] instead of [*content*] and [*pagetitle*].
I would like to this automatically so i created this plug to replace automatically normal tags by my TVs when my variabble of session is set to English by the user:
if($_SESSION['lang']=='en')
{
$french=array("[*content*]","[*pagetitle*]","[+content+]","[+pagetitle+]");
$english=array("[*content-en*]","[*pagetitle-en*]","[+content-en+]","[+pagetitle-en+]");
$output = $modx->documentOutput;
$modx->documentOutput = str_replace($french,$english,"$output");
}
It works well for the [*content*] but doesn(t work for the chunks with [+content+] !
How can i do to make it works also for the chunk’s tags [+ +]?
Thanks a lot for your helps !