Jump to content

[SOLVED]topmenu active


Recommended Posts

in blocktopmenu.php you can find code:

case 'LNK':
					$link = MenuTopLinks::get((int)$id, (int)$id_lang, (int)$id_shop);
					if (count($link))
					{
						if (!isset($link[0]['label']) || ($link[0]['label'] == ''))
						{
							$default_language = Configuration::get('PS_LANG_DEFAULT');
							$link = MenuTopLinks::get($link[0]['id_linksmenutop'], $default_language, (int)Shop::getContextShopID());
						}
						$this->_menu .= '<li><a href="'.Tools::HtmlEntitiesUTF8($link[0]['link']).'"'.(($link[0]['new_window']) ? ' target="_blank"': '').'>'.$link[0]['label'].'</a></li>'.PHP_EOL;
					}
					break;

change it to:

				case 'LNK':
					$link = MenuTopLinks::get((int)$id, (int)$id_lang, (int)$id_shop);
					if (count($link))
					{
						if (!isset($link[0]['label']) || ($link[0]['label'] == ''))
						{
							$default_language = Configuration::get('PS_LANG_DEFAULT');
							$link = MenuTopLinks::get($link[0]['id_linksmenutop'], $default_language, (int)Shop::getContextShopID());
						}
						$this->_menu .= '<li class="'.($link[0]['id_linksmenutop']==2 || $link[0]['id_linksmenutop']==1 ? 'class="active"':'').'"><a href="'.Tools::HtmlEntitiesUTF8($link[0]['link']).'"'.(($link[0]['new_window']) ? ' target="_blank"': '').'>'.$link[0]['label'].'</a></li>'.PHP_EOL;
					}
					break;
Link to comment
Share on other sites

oops my code is bad

instead of line:

						$this->_menu .= '<li class="'.($link[0]['id_linksmenutop']==2 || $link[0]['id_linksmenutop']==1 ? 'class="active"':'').'"><a href="'.Tools::HtmlEntitiesUTF8($link[0]['link']).'"'.(($link[0]['new_window']) ? ' target="_blank"': '').'>'.$link[0]['label'].'</a></li>'.PHP_EOL;

use

						$this->_menu .= '<li class="'.($link[0]['id_linksmenutop']==2 || $link[0]['id_linksmenutop']==1 ? 'active':'').'"><a href="'.Tools::HtmlEntitiesUTF8($link[0]['link']).'"'.(($link[0]['new_window']) ? ' target="_blank"': '').'>'.$link[0]['label'].'</a></li>'.PHP_EOL;

Link to comment
Share on other sites

hello

it looks the same as before

you changed code as i suggested?

 

btw. menu module needs to be recompiled, because it uses caching, moreover module contents is generated in php file (not in tpl as it is in other modules). THis is why it's worth to open module configuration page, and just hit save there, module will be regenerated with new code

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...