magento - how to style only the pressed/active menu item related to the
current page we are in?
i want to highlight only the pressed menu item in magento, can it be done?
i have tried to achieve this in many ways but none of them succeeded (i
can list some of them here if it helps)
thank you
1 tried php get url and compare it to the text written inside the a tag
2 tried built-in methodes/id specific to magento like li.active li.current
public function drawOpenCategoryItem($category) {
$html = '';
if (!$category->getIsActive()) {
return $html;
}
$html.= '<li';
if ($this->isCategoryActive($category)) {
$html.= ' class="active"';
}
$html.= '>'."\n";
$html.= '<a
href="'.$this->getCategoryUrl($category).'"><span>'.$this->htmlEscape($category->getName()).'</span></a>'."\n";
get the url in magento
<?php $magentoCurrentUrl = Mage::helper('core/url')->getCurrentUrl(); ?>
<?php echo $magentoCurrentUrl ; ?>
No comments:
Post a Comment