Joomla 如何自定义主菜单 [英] Joomla How to customize main menu
问题描述
我正在学习 joomla 并面临下一个问题.
I am learning joomla and faced the next problem.
这是 HTML 中的主菜单
Here is the main menu in HTML
<ul>
<li class="active"><a href="#">home</a></li>
<li><a href="#">bio</a></li>
<li><a href="#">news</a></li>
<li><a href="#" class="first-lev">projects<span class="ico"></span></a>
<div class="sub-nav">
<ul>
<li><a href="#">yegor<br/>zabelov<br/>trio</a></li>
<li><a href="#">gurzuf</a></li>
<li><a href="#">soundtracks</a></li>
</ul>
</div><!-- .sub-nav -->
</li>
...
</ul>
如何在 joomla 中自定义主菜单以:
1. 将类 .first-lev 添加到一些链接
2. 用这个类在item里面添加span
3. 为子导航添加包装 div
感谢任何帮助.
How is it possible to customize the main menu in joomla to:
1. add the class .first-lev to some links
2. add the span inside the item with this class
3. add the wrapper div for sub navigation
Appreciate any help.
推荐答案
要将类添加到某些链接,只需转到管理面板,选择您的菜单项.进入链接类型选项->链接CSS样式,手动添加类.
To add the class to the some links, just go to the admin panel, select your menu item. Go to the link type options->link CSS style, and add class manually.
您需要编辑 default_component.php 或 defaul_url.php
You need to edit default_component.php or defaul_url.php
你需要编辑default.php
You need to edit default.php
http://docs.joomla.org/How_to_override_the_output_from_the_Joomla!_core
要自定义菜单布局,只需复制
http://docs.joomla.org/How_to_override_the_output_from_the_Joomla!_core
To customize menu layout, just copy
/modules/mod_menu/tmpl
到:
/templates/your_template/html/mod_menu
然后自定义您刚刚复制的文件.此文件覆盖系统 mod_menu 文件.
不要忘记添加:
And then customize the files you just copied. This files override system mod_menu files.
Don't forget to add:
<folder>html</folder>
在你的 templateDetails.xml 中.
at you templateDetails.xml.
这篇关于Joomla 如何自定义主菜单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!