dongxiong5546 2012-11-17 11:18
浏览 72
已采纳

joomla 2.5导航菜单字幕[关闭]

Hi I am web designer and I would like to know how to set menu subtitle? It is easily possible with yoo themes but I need to know how it is done without using YooTheme templates. I think there is need of little modification in mod_menu but I don't know what exactly. I googled all day and can't find a solution.

  • 写回答

1条回答 默认 最新

  • douyimin1083 2012-11-19 10:12
    关注

    There are certainly better solutions but i've done it this way:

    Insert a charakter in the name of your menu-item. For example a "|". It should look like this: Title | Subtitle. At this position you can divide the name.

    Now you have to override the file default_component.php in modules/mod_menu/tmpl.

    Add this lines:

    $parts = explode("|", $linktype);
    // the "|" is the divider
    if(isset($parts[1])){
        $linktype = $parts[0].'<span>'.$parts[1].'</span>';
    }else{
        $linktype = $parts[0];
    };
    

    after:

    $class = $item->anchor_css ? 'class="'.$item->anchor_css.'" ' : '';
    $title = $item->anchor_title ? 'title="'.$item->anchor_title.'" ' : '';
    if ($item->menu_image) {
            $item->params->get('menu_text', 1 ) ?
            $linktype = '<img src="'.$item->menu_image.'" alt="'.$item->title.'" /><span class="image-title">'.$item->title.'</span> ' :
            $linktype = '<img src="'.$item->menu_image.'" alt="'.$item->title.'" />';
    }
    else { $linktype = $item->title;
    }
    

    Now you have a span around the subtitle and it's possible to style it.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 树莓派与pix飞控通信
  • ¥15 自动转发微信群信息到另外一个微信群
  • ¥15 outlook无法配置成功
  • ¥30 这是哪个作者做的宝宝起名网站
  • ¥60 版本过低apk如何修改可以兼容新的安卓系统
  • ¥25 由IPR导致的DRIVER_POWER_STATE_FAILURE蓝屏
  • ¥50 有数据,怎么建立模型求影响全要素生产率的因素
  • ¥50 有数据,怎么用matlab求全要素生产率
  • ¥15 TI的insta-spin例程
  • ¥15 完成下列问题完成下列问题