Herland Posted August 15, 2012 Share Posted August 15, 2012 I have the module [top horizontal menu 1.3v] which main css is superfish-modified.css. I am looking towards modifing one menu item, but I have not had success finding the page code to add the style or class to that piece of text, any help? I am trying to modify the 'sale' item to red color. webpage is: www.laguarda.cl Link to comment Share on other sites More sharing options...
keweli Posted August 15, 2012 Share Posted August 15, 2012 To change the text colour of the menu items, adjust the color property in: .sf-menu a { display:block; position:relative; color:#000; } By editing the CSS alone, you cannot make only the sale item a different colour from the rest. Link to comment Share on other sites More sharing options...
Wynn Posted August 15, 2012 Share Posted August 15, 2012 (edited) To change the CSS of your specific link, open up superfish-modified.css and add: .sf-menu > li:nth-child(3) a{color:#FF0000;} to change the style on hover: .sf-menu > li:nth-child(3) a:hover{your css here;} where (3) is the third link of the menu, you can change this to match a specific link. This won't make any change though on some older browsers. IE 6,7,8. Edited August 15, 2012 by Wynn (see edit history) 3 Link to comment Share on other sites More sharing options...
Herland Posted August 15, 2012 Author Share Posted August 15, 2012 Thanks Wynn, it did the trick, but it changes the color of the 3rd item in the vertical drop down menu, is there a fix for this? thanks Link to comment Share on other sites More sharing options...
Wynn Posted August 15, 2012 Share Posted August 15, 2012 Yes, sorry. I edited my first post. should read .sf-menu > li:nth-child(3) a{color:#FF0000;} Link to comment Share on other sites More sharing options...
Herland Posted August 15, 2012 Author Share Posted August 15, 2012 It works fine, thank you a lot Wynn Link to comment Share on other sites More sharing options...
guspedalo Posted November 19, 2012 Share Posted November 19, 2012 Is there any way to add a class to each item of the menu ? Link to comment Share on other sites More sharing options...
benjamin utterback Posted November 19, 2012 Share Posted November 19, 2012 Topic Moved to Correct Forum Link to comment Share on other sites More sharing options...
vekia Posted November 19, 2012 Share Posted November 19, 2012 Is there any way to add a class to each item of the menu ? in my opinion yes, but without change tpl files it isn't possible. Link to comment Share on other sites More sharing options...
guspedalo Posted November 19, 2012 Share Posted November 19, 2012 in my opinion yes, but without change tpl files it isn't possible. It should be by default. where can I find $menu ? I don't mind to change the tpl file to achieve it. thanks for replying vekia Link to comment Share on other sites More sharing options...
vekia Posted November 19, 2012 Share Posted November 19, 2012 (edited) you must edit blocktopmenu module blocktopmenu.php file. you need to add some changes to $this->_menu variable for example: if ($this->page_name=='cms'){ $newclass="mynewclass"; } $this->_menu .= '<li '.$selected.' class="'.$newclass.'">'; $this->_menu .= '<a href="'.$links[0]['link'].'">'.$cms->meta_title.'</a>'; $this->_menu .= '</li>'; Edited November 19, 2012 by vekia (see edit history) Link to comment Share on other sites More sharing options...
guspedalo Posted November 19, 2012 Share Posted November 19, 2012 you must edit blocktopmenu module blocktopmenu.php file. you need to add some changes to $this->_menu variable for example: if ($this->page_name=='cms'){ $newclass="mynewclass"; } $this->_menu .= '<li '.$selected.' class="'.$newclass.'">'; $this->_menu .= '<a href="'.$links[0]['link'].'">'.$cms->meta_title.'</a>'; $this->_menu .= '</li>'; I just wanted to add an ID to each item -> class="'.$id.'" . final : $this->_menu .= '<li class="'.$id.'" '.$selected.'> It's a simple solution. something like this should be in the core. Does the job for me now and hope can help anyone out there. cheers vekia Link to comment Share on other sites More sharing options...
do2go Posted December 2, 2013 Share Posted December 2, 2013 Hello! I know this topic is quite dead. But when I go and try this solution from post above - I see no changes at blockmenutop menu. When I look at the source after update - there is just <li> I would like also mention that I've did add classes to all $this->_menu .= '<li'.$selected.'> so all looks like: $this->_menu .= '<li class="'.$id.'" '.$selected.'> W/o any change. Can some one help me with that topic? I using latest presta 1.5.6 Link to comment Share on other sites More sharing options...
davidmr92 Posted March 11, 2015 Share Posted March 11, 2015 you must edit blocktopmenu module blocktopmenu.php file. you need to add some changes to $this->_menu variable for example: if ($this->page_name=='cms'){ $newclass="mynewclass"; } $this->_menu .= '<li '.$selected.' class="'.$newclass.'">'; $this->_menu .= '<a href="'.$links[0]['link'].'">'.$cms->meta_title.'</a>'; $this->_menu .= '</li>'; I just wanted to add an ID to each item -> class="'.$id.'" . final : $this->_menu .= '<li class="'.$id.'" '.$selected.'> It's a simple solution. something like this should be in the core. Does the job for me now and hope can help anyone out there. cheers vekia Hello, works on PS 1.6? I dont find nothing similar like that. I want a different ID for each category Link to comment Share on other sites More sharing options...
kilian.gr Posted June 2, 2017 Share Posted June 2, 2017 Yes, sorry. I edited my first post. should read .sf-menu > li:nth-child(3) a{color:#FF0000;} Hago justamente esto que me dices y no me aparece la modificación al subir el archivo y actualizar la página... Link to comment Share on other sites More sharing options...
kilian.gr Posted June 2, 2017 Share Posted June 2, 2017 Ya está, necesitava limpar la caché. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now