Dear All,
I would like to request your assiatnce in order to fix an issue with babel.
I ma trying to setup a multilanguage web site (fr, en). Its URL is temporarely:
http://www.mywebsite.com/modx/
(later I will move it to the root)
Could let me what I did wrong.
1) I created a contact call "en" and I added 4 new parameters
- key: basel_url, name: Base URL, value :/modx/, lexique: language
- key: cultureKey, name Culture key, value : en, lexique : language
- key : site_start, name : Site start, value : 13, lexique : language
- key: site_url, name : Site URL, value :
http://www.mywebsite.com/modx/en/
2) I modifed the web context and added 4 parameters
- key: basel_url, name: Base URL, value :/modx/, lexique: language
- key: cultureKey, name Culture key, value : fr, lexique : language
- key : site_start, name : Site start, value : 1, lexique : language
- key: site_url, name : Site URL, value :
http://www.mywebsite.com/modx/
3) I change the permission System->Acces list, I right click on (anonymous) and I added the "en" context with the following right:
en - Member - 9999 - Load Only
Finally I added into my template [[!BabelLinks]]
My problems
For now I can create trabslated pages, and the pages are create under the "en".
On my web pages, I can see the language menu, but when I click on the "english" links I can not see the english menu.
For exemple, when I click on the menu "Access media" and then I click on the english links to display the english version, the trabslated page can not be found.
MY url is like this :
http://www.mywebsite.com/modx/en/media-access.html
I also created a plugin called "gateway" with that code
<?php
//make sure the plugin does not run on the mgr context (the manager)
if ( $modx->context->get( 'key' ) != 'mgr') {
/**
* grab the current context from the request "c" parameter (or context_param_alias from system settings)
* the alternative .htaccess friendly URL rewrite rule must be activated
*/
$cntxt_param = $modx->getOption('context_param_alias', null, 'cultureKey');
if ( isset( $_REQUEST[$cntxt_param] ) && $_REQUEST[$cntxt_param] != '' ) {
switch ( $_REQUEST[$cntxt_param] ) {
case 'fr':
$modx->switchContext('web');
break;
case 'en':
$modx->switchContext('en');
break;
default:
// nothing because web is default
break;
}
}
}
On my .htaccess file, I add this
#BABEL
# redirect all requests to /de/favicon.ico and /nl/favicon.ico
# to /favicon.ico
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(fr|en)/favicon.ico$ favicon.ico [L,QSA]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(fr|en)/manager/templates/rives/(.*)$ manager/templates/rives/$2 [L,QSA]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(fr|en)/images(.*)$ images$2 [L,QSA]
# redirect all requests to /de/assets* and /nl/assets* to /assets*
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(fr|en)/assets(.*)$ assets$2 [L,QSA]
# redirect all other requests to /de/* and /nl/*
# to index.php and set the cultureKey parameter
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(fr|en)?/?(.*)$ index.php?cultureKey=$1&q=$2 [L,QSA]
#END BABEL
Do you have an idea which can help me?
Thanl
[ed. note: pierrot1010 last edited this post 14 years, 11 months ago.]