gpt4 book ai didi

css - 为静态 Magento 导航创建 "actIve"状态

转载 作者:太空宇宙 更新时间:2023-11-03 19:05:15 25 4
gpt4 key购买 nike

我在 header.phtml 文件中创建了一个静态导航菜单。

<li><a href="/about.html"> about</a></li> <li><a href="/store.html">store</a></li>等..

如果页面处于事件状态,如何将“事件”类添加到列表项?

谢谢,-山姆

最佳答案

Magento 的内置方法在导航 block 类中:

isCategoryActive($category)

不过,您应该能够用它来检查它,因为您已将模板更改为静态导航,我猜您没有使用正确的模型来调用该函数。

关于css - 为静态 Magento 导航创建 "actIve"状态,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10555091/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com