twitter-bootstrap Joomla 3 中的 Bootstrap 3 导航栏

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/19863558/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-21 19:07:59  来源:igfitidea点击:

Bootstrap 3 Navbar in Joomla 3

twitter-bootstrapjoomlatwitter-bootstrap-3navbarjoomla3.0

提问by Kris Hunt

I'm trying to create a Bootstrap 3 template in Joomla 3. My main navigation module is called "nav", so I place it on the page with the snippet:

我正在尝试在 Joomla 3 中创建一个 Bootstrap 3 模板。我的主导航模块被称为“nav”,所以我将它放在带有代码段的页面上:

<jdoc:include type="modules" name="nav" style="none" />

This creates a ul with the class "nav menu". I need this to be "nav navbar-nav" instead because of the way Bootstrap 3's navbar is set up. How would you go about doing this? Is there a way to do it without Javascript? Here's what I've got so far:

这将创建一个带有“导航菜单”类的 ul。由于 Bootstrap 3 的导航栏的设置方式,我需要将其设为“nav navbar-nav”。你会怎么做?有没有办法在没有 Javascript 的情况下做到这一点?这是我到目前为止所得到的:

<nav class="navbar navbar-default" role="navigation">
<div class="navbar-header">
    <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-ex1-collapse">
        Menu
    </button>
</div> <!-- navbar-header -->

<div class="collapse navbar-collapse navbar-ex1-collapse">
    <jdoc:include type="modules" name="nav" style="none" />
</div> <!-- navbar-collapse -->
</nav>

回答by Lodder

In the Joomla backend, go to the Menu module, click on the "Advanced" tab and you will see a field called "Module Class Suffix".

在 Joomla 后端,转到菜单模块,单击“高级”选项卡,您将看到一个名为“模块类后缀”的字段。

In there, add the following:

在那里,添加以下内容:

 navbar-nav

Note that there is a space before it

注意前面有个空格

回答by Muhammad Yousuf

The quick solution to this is a module that you can customize as well.

对此的快速解决方案是您也可以自定义的模块。

http://thegrue.org/responsive-menu-module-joomla/

http://thegrue.org/responsive-menu-module-joomla/

Download from above link. It offers responsive menu. You just need to define a module position in your template and assign module there.

从上面的链接下载。它提供响应式菜单。您只需要在模板中定义一个模块位置并在那里分配模块。