hi, i want to change the css file (common.css) when specific language is changed
i tried to look out where the code may be and found out that in "BxDolTemplate.php"
there are some setting about css.
this file is long and i don't want to destroy anything. if there is somebody that may have a clue
about this that will help me a lot. thanks
Always remember that the future comes one day at a time. |
You would need to change core files that control loading of CSS files; do you have php skills of any level? Geeks, making the world a better place |
Always remember that the future comes one day at a time. |
anyone ?  Always remember that the future comes one day at a time. |
Hello
hi, i want to change the css file (common.css) when specific language is changed
i tried to look out where the code may be and found out that in "BxDolTemplate.php"
there are some setting about css.
this file is long and i don't want to destroy anything. if there is somebody that may have a clue
about this that will help me a lot. thanks
Could you please describe the idea in more details. Do you want to load different CSS files in dependence with currently selected language?
Best Regards AntonLV - http://www.boonex.com/market/posts/AntonLV |
yes, exactly.
the css will change according to language that has been chosen.
for example if the language is xyz then "common.css" turn to "common.xyz.css"
i kind a found a way by changing the directory but its messing up the path of images.
Always remember that the future comes one day at a time. |
I don't have an answer at the moment, but instinct tells me that it might be more straightforward to switch templates rather than individual css files. That way you could just recode the language switcher to append the url something like: index.php?lang=ru&skin=SomeTemplateName My opinions expressed on this site, in no way represent those of Boonex or Boonex employees. |
you can use something like this in the header of your template...
var url = $(location).attr('href');var fileName = url.slice(url.lastIndexOf('/')+1);switch(fileName){case'?lang=ru': $('#nav').css('ru.css');break;case'?lang=en': $('#nav').css('en.css');break;}
Or like crazy said... switch to a different template... either way there is a million java script ways to do this..
https://dolphin-techs.com - Skype: Dolphin Techs |
i don't want to change the template 
only the language (and by that the relevant css).
what will happen if i change language?
let say now is English and i click on xyz-> the php code will know to use all the css files with xyz (common.xyz.css, general.xyz.css etc.)
and if i click back on English then the php code will know to return the default css files (common.css, general.css etc.)
Always remember that the future comes one day at a time. |
you can use something like this in the header of your template...
var url = $(location).attr('href');var fileName = url.slice(url.lastIndexOf('/')+1);switch(fileName){case'?lang=ru': $('#nav').css('ru.css');break;case'?lang=en': $('#nav').css('en.css');break;}
Or like crazy said... switch to a different template... either way there is a million java script ways to do this..
the problem is that languages are stored in cookies , not only on url's.
Always remember that the future comes one day at a time. |
Hello
OK. Try to use the following. Open inc/classes/BxDolTemplate.php file and find the following function
function _getAbsoluteLocationCss($sType, $sName)
then completely replace it with the code below
function _getAbsoluteLocationCss($sType, $sName) { $sLangDef = 'en'; $sLangCur = bx_lang_name(); if($sLangCur != $sLangDef) { $sResult = $this->_getAbsoluteLocation($sType, $this->_sFolderCss, basename($sName, '.css') . '.' . $sLangCur . '.css'); if(!empty($sResult)) return $sResult; }
return $this->_getAbsoluteLocation($sType, $this->_sFolderCss, $sName); }
The code will do the following. If current langauge is not equal to default one (en) then the code generates updated CSS file name. For example, common.ru.css for common.css in case of the Russian language is selected. Then it will try to search for the new CSS file and if it's available then uses it otherwise uses the default one.
Best Regards AntonLV - http://www.boonex.com/market/posts/AntonLV |
works like charm . thank you anton.
and everybody..
Always remember that the future comes one day at a time. |
Hello
works like charm . thank you anton.
You are welcome! :)
Best Regards AntonLV - http://www.boonex.com/market/posts/AntonLV |