导航

2012-11-05 41 views
1

我在Drupal开发一个网站添加跨度7导航

http://lorrells.seoperspective.com/

现在这里的问题侧边栏菜单(左) 我的客户希望在图像下方 enter image description here

像意味着他想要在链接 以下的少量文本,所以我想在下面添加“标题”文本,以便我可以设计它的样式

我要的是在page.tpl.php中

<ul> 
    <li class="menu-359 first"><a class="Litigation" title="Our niche Litigation Department punches well above its weight." href="http://lorrells.seoperspective.com/Litigation">Litigation</a><span>Our niche Litigation Department punches well above its weight.</span></li> 
</ul> 

代码

<div class="sidebar_menu"> 
    <?php 

     $menu = menu_navigation_links('menu-sidebarmenu'); 
     print theme('links__menu-sidebarmenu', array('links' => $menu)); 


    ?> 

    </div> 

回答

1

方法1: 你吃过看看this的contrib模块?它会公开一个复选框,以在菜单标题中输入html。但是,我警告你,菜单项中的html是有风险的业务。确保权限设置正确。

方法2: 另一种可以达到同样效果的方法是创建一个具有自定义标记的块。但是,如果您允许将其编辑给您的客户,那么这可能是一场等待发生的灾难。

方法3: 如果您在玩钩子时感觉很舒服,hook_menu_link_alter(&$item)可用于将html属性设置为true,并且还可以根据需要重新设置标题的格式。

3
function ThemeName_link($variables) { 
    return '<a href="' . check_plain(url($variables['path'], $variables['options'])) . '"' . drupal_attributes($variables['options']['attributes']) . '><span>' . ($variables['options']['html'] ? $variables['text'] : check_plain($variables['text'])) . '</span></a>'; 
} 

它适用于您主题中的所有链接。