Magento在导航菜单中弹出悬停标题文本

Magento在导航菜单中弹出悬停标题文本,magento,Magento,目前我正在使用magento 1.6.1.0。我有6个类别。当悬停到任何类别时,我希望显示一些文本。假设我的第一个类别是家具,当将光标移到家具菜单时,我希望文本“单击以查看我们的家具目录”显示为小的弹出测试。通常在html中,我会使用title=“单击查看我们的家具目录”来完成此操作 但在php中,我不知道该怎么做。到目前为止,我找到了类别调用的phtml文件。来自app/design/frontend/default/mytheme/template/catalog/navigation/to

目前我正在使用magento 1.6.1.0。我有6个类别。当悬停到任何类别时,我希望显示一些文本。假设我的第一个类别是家具,当将光标移到家具菜单时,我希望文本“单击以查看我们的家具目录”显示为小的弹出测试。通常在html中,我会使用title=“单击查看我们的家具目录”来完成此操作

但在php中,我不知道该怎么做。到目前为止,我找到了类别调用的phtml文件。来自app/design/frontend/default/mytheme/template/catalog/navigation/top.phtml


请告诉我怎么做。

首先,我的回答不是解决您问题的好方法,但它会解决您的问题。好的方法是覆盖块,而不是编辑核心块

编辑文件app/code/core/Mage/Catalog/Block/Navigation.php
查找行
$html[]=“getCategoryUrl($category)。”“.$linkClass.>”;
(对我来说是第286行)
将其转换为

$html[]='escapeHtml($category->getName())。'collection“href=“”。$this->getCategoryUrl($category)。“。$linkClass.>”

为此,您应该对Magento有一些了解

打开文件app/code/core/Mage/Catalog/Block/Navigation.php,然后转到第286行

$html[] = '<a href="'.$this->getCategoryUrl($category).'"'.$linkClass.'>';
$html[]='';
你应该把这行改成

$html[] = '<a href="'.$this->getCategoryUrl($category).'"'.$linkClass.' title="click to see our '. $$this->escapeHtml($category->getName()) .' colections">';
$html[]='';