sw1ft25 Posted June 19, 2014 Share Posted June 19, 2014 (edited) Hi I would really need a hand here. I've been working on a topmenu with images instead of text. All good but preferably i would like to add different background image for both languages that are present in my store. Is there a way to link one css for each language? Or keep one css standard and just add one css file when the default language changes? Edited June 20, 2014 by sw1ft25 (see edit history) Link to comment Share on other sites More sharing options...
El Patron Posted June 19, 2014 Share Posted June 19, 2014 is .css in module folder (menu module) or global theme? Link to comment Share on other sites More sharing options...
sw1ft25 Posted June 20, 2014 Author Share Posted June 20, 2014 Hello. Yes, it's superfish-modified.css Link to comment Share on other sites More sharing options...
vekia Posted June 20, 2014 Share Posted June 20, 2014 hello you can achieve it but only with module modification, there is no other way at the moment. in this case, in module file, in hookdisplayTop function you have to change: $this->context->controller->addCSS($this->_path.'css/superfish-modified.css'); to: if ((int)Context::getContext()->language->id==1){ $this->context->controller->addCSS($this->_path.'css/lagnuage1-superfish-modified.css'); } elseif ((int)Context::getContext()->language->id==2){ $this->context->controller->addCSS($this->_path.'css/lagnuage2-superfish-modified.css'); } elseif ((int)Context::getContext()->language->id==3){ $this->context->controller->addCSS($this->_path.'css/lagnuage3-superfish-modified.css'); } elseif ((int)Context::getContext()->language->id==X){ $this->context->controller->addCSS($this->_path.'css/lagnuageX-superfish-modified.css'); } you can add as many if conditions as you want :-) 1 Link to comment Share on other sites More sharing options...
sw1ft25 Posted June 20, 2014 Author Share Posted June 20, 2014 Thank you for this fast response! But let me make it clear for me: I have to edit blocktopmenu.php from root/modules/blocktopmenu I added these lines: $this->context->controller->addJS($this->_path.'js/hoverIntent.js'); $this->context->controller->addJS($this->_path.'js/superfish-modified.js'); $this->context->controller->addJS($this->_path.'js/blocktopmenu.js'); $this->context->controller->addCSS($this->_path.'css/blocktopmenu.css'); if ((int)Context::getContext()->language->id==1){ $this->context->controller->addCSS($this->_path.'css/superfish-modified.css'); } elseif ((int)Context::getContext()->language->id==2){ $this->context->controller->addCSS($this->_path.'css/en.css'); And all i gott is a blank page. My modified css file is in root/themes/default-bootstrap/css/modules/blocktopmenu/css I'm a bit confused why I got the blank page display. Thanks Link to comment Share on other sites More sharing options...
vekia Posted June 20, 2014 Share Posted June 20, 2014 can you show how your modified function looks like? Link to comment Share on other sites More sharing options...
sw1ft25 Posted June 20, 2014 Author Share Posted June 20, 2014 public function hookDisplayTop($param) { $this->user_groups = ($this->context->customer->isLogged() ? $this->context->customer->getGroups() : array(Configuration::get('PS_UNIDENTIFIED_GROUP'))); $this->page_name = Dispatcher::getInstance()->getController(); if (!$this->isCached('blocktopmenu.tpl', $this->getCacheId())) { if (Tools::isEmpty($this->_menu)) $this->makeMenu(); $this->smarty->assign('MENU_SEARCH', Configuration::get('MOD_BLOCKTOPMENU_SEARCH')); $this->smarty->assign('MENU', $this->_menu); $this->smarty->assign('this_path', $this->_path); } $this->context->controller->addJS($this->_path.'js/hoverIntent.js'); $this->context->controller->addJS($this->_path.'js/superfish-modified.js'); $this->context->controller->addJS($this->_path.'js/blocktopmenu.js'); $this->context->controller->addCSS($this->_path.'css/blocktopmenu.css'); if ((int)Context::getContext()->language->id==1){ $this->context->controller->addCSS($this->_path.'css/superfish-modified.css'); } elseif ((int)Context::getContext()->language->id==2){ $this->context->controller->addCSS($this->_path.'css/en.css'); $html = $this->display(__FILE__, 'blocktopmenu.tpl', $this->getCacheId()); return $html; } Like this Link to comment Share on other sites More sharing options...
sw1ft25 Posted June 20, 2014 Author Share Posted June 20, 2014 Oh, your question gave me already the response. I forgot to add a } at end. Thank you very much. You're the the best. Cheers. Link to comment Share on other sites More sharing options...
vekia Posted June 20, 2014 Share Posted June 20, 2014 exactly as i suspected thank you for confirmation :-) 1 Link to comment Share on other sites More sharing options...
Recommended Posts