Php 修改mod_mainmenu以获取菜单项上的悬停文本
我的菜单栏使用了mod_mainmenu。现在,当我将鼠标悬停在菜单项上时,我想要一个文本。有人能帮我吗 也请告诉文件,我在哪里做修改Php 修改mod_mainmenu以获取菜单项上的悬停文本,php,css,joomla,Php,Css,Joomla,我的菜单栏使用了mod_mainmenu。现在,当我将鼠标悬停在菜单项上时,我想要一个文本。有人能帮我吗 也请告诉文件,我在哪里做修改 非常感谢。在mod_主菜单中,转到创建菜单的位置。向锚添加了标题属性 您可以在标记中添加title属性以在鼠标悬停中显示它。为了在标签中添加标题,您必须修改mod_main菜单的helper.php。 下面是路径-modules/mod_main menu/helper.php 在上述文件中搜索此代码- switch ($tmp->browserNav)
非常感谢。在mod_主菜单中,转到创建菜单的位置。向
锚添加了标题
属性
您可以在标记中添加title属性以在鼠标悬停中显示它。为了在标签中添加标题,您必须修改mod_main菜单的helper.php。
下面是路径-modules/mod_main menu/helper.php
在上述文件中搜索此代码-
switch ($tmp->browserNav)
{
default:
case 0:
// _top
$data = '<a title="'.$tmp->name.'" href="'.$tmp->url.'">'.$image.$tmp->name.'</a>';
break;
case 1:
// _blank
$data = '<a title="'.$tmp->name.'" href="'.$tmp->url.'" target="_blank">'.$image.$tmp->name.'</a>';
break;
case 2:
// window.open
$attribs = 'toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,'.$this->_params->get('window_open');
// hrm...this is a bit dickey
$link = str_replace('index.php', 'index2.php', $tmp->url);
$data = '<a title="'.$tmp->name.'" href="'.$link.'" onclick="window.open(this.href,\'targetWindow\',\''.$attribs.'\');return false;">'.$image.$tmp->name.'</a>';
break;
}
开关($tmp->browserNav)
{
违约:
案例0:
//_top
$data='';
打破
案例1:
//_blank
$data='';
打破
案例2:
//打开窗户
$attribs='toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizeable=yes'。$this->_params->get('window_open');
//人力资源管理…这有点棘手
$link=str_replace('index.php','index2.php',$tmp->url);
$data='';
打破
}
并添加title属性及其值
你也可以试试
希望这会有所帮助。你的joomla版本是什么?谢谢Irfan,但是在哪里添加标题标签??在所有这三种情况下??你能为这个写些代码吗also@user1903194:标题应该在标签中。我已经更新了答案。如果这不起作用,请告诉我。谢谢Irfan。但当我使用此代码时,我的所有菜单项都消失了(.我使用的是准确的代码。感谢Irfan对我的问题给予关注。我的问题解决了。使用标题技巧和条件语句,它起了作用。.谢谢你。:)heyy Dasun谢谢你。。你是个救生员。。只是使用了标题技巧和一些条件语句,得到了我一直想要的方式:)
switch ($tmp->browserNav)
{
default:
case 0:
// _top
$data = '<a title="'.$tmp->name.'" href="'.$tmp->url.'">'.$image.$tmp->name.'</a>';
break;
case 1:
// _blank
$data = '<a title="'.$tmp->name.'" href="'.$tmp->url.'" target="_blank">'.$image.$tmp->name.'</a>';
break;
case 2:
// window.open
$attribs = 'toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,'.$this->_params->get('window_open');
// hrm...this is a bit dickey
$link = str_replace('index.php', 'index2.php', $tmp->url);
$data = '<a title="'.$tmp->name.'" href="'.$link.'" onclick="window.open(this.href,\'targetWindow\',\''.$attribs.'\');return false;">'.$image.$tmp->name.'</a>';
break;
}