ExpressionEngine 2 中的动态导航

发布于 2024-10-04 21:29:45 字数 177 浏览 0 评论 0原文

我是 expressionEngine 2 的新手,我面临着一个需要大量导航和子导航的网站。快速浏览后,似乎我必须将导航放入模板中,并且必须对其进行硬编码。

我发现的唯一方法是使用名为 NavEE 的模块,但对于创建的每个页面,我们仍然需要创建一个导航项。有没有办法根据创建的节点直接从模板生成导航。

谢谢。

I'm new to expressionEngine 2 and I'm facing a web site that needs a massive navigation and sub navigation. After having a quick look, it seems that I have to put the nav in template and it has to be hard coded.

The only way I've found was to use the module called NavEE but still, for every page created, we need to create a navigation item. Is there a way to generate the nav directly from the template based on the nodes created.

Thanks.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

梦在深巷 2024-10-11 21:29:45

有几种方法可以做到这一点,但这主要取决于您如何设置频道。例如,如果您有一个名为“页面”的频道,您可以这样开始动态导航:

<ul>
{exp:channel:entries channel="pages" dynamic="off"}
<li><a href="{url_title}">{title}</a></li>
{/exp:channel:entries}
</ul>

这应该会给您一个良好的基础动态导航。如果您想更进一步,您可以使用相关条目自定义字段并将其他条目(作为子页面)关联回该条目。

如果您确实要构建复杂的导航和结构,请考虑购买结构模块 - http://buildwithstruct.com/ 。如果您要这样做,则需要在构建网站时牢记结构。

There are a few ways to do this, but it mostly depends on how you're setting up your channels. For example, if you have a channel called 'pages' you could start your dynamic navigation this way:

<ul>
{exp:channel:entries channel="pages" dynamic="off"}
<li><a href="{url_title}">{title}</a></li>
{/exp:channel:entries}
</ul>

That should give you a good base dynamic navigation. If you want to go further, you could use a related entries custom field and relate other entries (as subpages) back to the entry.

If you're really building out a complex navigation and structure, take a look at purchasing the Structure module - http://buildwithstructure.com/. You'll need to build your site with Structure in mind if you're going that way though.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文