如何在Concrete5中使菜单可编辑?
我一直在寻找一些指南,可以告诉我如何在添加到 Concrete 5 中时使现有菜单可编辑。
这是我现在使用的菜单,我希望能够在 c5 中编辑它:
<div class="menu">
<ul>
<li><a href="default.php" class="active"><span>Hem</span></a></li>
<li><a href="about.php"><span>Om oss</span></a></li>
<li><a href="services.php"><span>Tjänster</span></a></li>
<li><a href="references.php"><span>Referenser</span></a></li>
<li><a href="contact.php"><span> Kontakt</span></a></li>
</ul>
</div>
链接在 c5 中根本不起作用,所以如果有人能帮助我一点,我将不胜感激!
谢谢!
I've been looking around for some guide that could tell me how to make an existing menu editable when added in Concrete 5.
Here's the menu I'm using now, I'd like to be able to edit it in c5:
<div class="menu">
<ul>
<li><a href="default.php" class="active"><span>Hem</span></a></li>
<li><a href="about.php"><span>Om oss</span></a></li>
<li><a href="services.php"><span>Tjänster</span></a></li>
<li><a href="references.php"><span>Referenser</span></a></li>
<li><a href="contact.php"><span> Kontakt</span></a></li>
</ul>
</div>
The links doesn't work at all in c5, so if anyone could help me a little that would be greatly appreciated!
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
使用任何 CMS 的好处之一是它会自动为您创建导航菜单 - 这样,当用户添加新页面时,它们会自动显示在菜单中。
具体来说,在 Concrete5 中,您可以使用“AutoNav”块来执行此操作。与任何块一样,可以将其添加到页面上的区域,但由于您通常希望导航菜单出现在每个页面的同一位置,因此您也可以直接在模板代码中添加该块。
因此,对于您的菜单(这是一个没有下拉菜单的一级菜单),请将您的导航菜单 html 替换为以下代码:
现在您需要对 CSS 进行更改,因为该代码将生成与以下内容略有不同的 HTML:你所拥有的——它看起来更像是这样的:
区别在于没有周围的div(尽管如果你想通过在开始和结束div标签中包围上面的php代码来保留它),导航项周围没有跨度,以及所选项目的类是“导航选择”而不是“当前”。
One of the nice benefits of using any CMS is that it will automatically create the nav menu for you -- so that when users add new pages they automatically show up in the menu.
In Concrete5 specifically, the way you do this is with the "AutoNav" block. As with any block, this can be added to areas on your page, but since you generally want the nav menu to appear on EVERY page in the same place, you can also add the block directly in your template code.
So, for your menu (which is a one-level menu without a dropdown), replace your nav menu html with this code:
Now you will need to make a change to your CSS, because that code will generate HTML that is slightly different than what you have -- it looks more like this:
The differences are that there's no surrounding div (although you could leave that if you wanted by surrounding the php code above in the opening and closing div tags), there's no span around the nav items, and the class for a selected item is "nav-selected" instead of "current".