We have an EE 1.7 install running MSM, each site being a different linguistic version of our website. Some templates are different for each site. These are stored in subfolders in the templates/ folder (/templates/en/, templates/fr/, etc.). A path.php global variable called current_lang is used in order for the front end to load the correct template.
In our path.php file
$global_vars = array(
'variable' => 'value',
'current_lang' => 'en'
); // This array must be associativeIn our config.php file:
$conf['tmpl_file_basepath'] = $conf['server_path']."/system/templates/".$global_vars['current_lang']."/";This works for the front end without any problem.
On the CP side, it doesn’t work. Whatever the website in MSM, the template base path outputs as: “/ee-admin/templates//”. A var_dump($global_vars) shows that the value of the array is “null” in the CP ... I am guessing because the CP does not read path.php.
Output is correct on the front end:
'current_lang' => string 'en' (length=2)Is there a way to make it work so our newly created templates saved as files are saved / created in the correct folder?
Currently, I am commenting out the line overriding the tmpl_file_basepath in config.php, set it manually in the CP, create my templates, uncomment the line and repuload config.php, which is not really convenient.