N2CMS 和下拉导航菜单

发布于 2024-10-31 11:06:44 字数 260 浏览 7 评论 0原文

我正在使用 N2 CMS,我想创建下拉 JavaScript 菜单。
我只想到这两个选项:

  1. 创建一个代表下拉菜单的新页面类型。
  2. 递归加载所有页面并动态生成菜单。

我想有一个更好的解决方案,但我在互联网上找不到任何东西。

这两个选项的问题是:
如果我选择选项 1,那么我无法控制访问权限和发布状态。
如果我选择选项 2,那么我会多次点击数据库来生成菜单。

任何帮助将不胜感激!

I'm using the N2 CMS and I'd like to create the dropdown javascript menu.

Only these two options come to my mind:

  1. Create a new page type which represents the dropdown menu.
  2. Recursively load all pages and dynamically generate the menu.

I guess that there is a much better solution but I could not find anything on the Internet.

Problems with these two options are:
If I choose option 1, than I can not control the access rights and published status.

If I choose the option 2, than I'll have many hits to database just to generate the menu.

Any help would be greatly appreciated!

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

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

发布评论

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

评论(1

浅浅淡淡 2024-11-07 11:06:44

选项#2 是正确的选择。对数据库进行多次点击并不是问题。 CMS 系统和 RDBMS 系统正是为此目的而设计的 - 获取数据并维持相当高的负载。随着您的网站开始增长,并且访问者越来越多,下拉菜单绝对不会是您网站最薄弱的链接,您肯定会遇到网站其他部分的问题。

不管怎样,N2CMS 是高度优化的,并且在 NHibernate 上运行,NHibernate 也有自己的缓存机制,所以继续获取站点树。

Option #2 is the way to go. Having many hits to your database is not a problem. CMS systems and RDBMS systems are made exactly for this purpose - to fetch data and to sustain reasonably high load. As your site starts to grow, and you get more and more visitors, drop down menu will definitely not be weakest link of your site, you will be certainly experiencing problems with other segments of your site.

Anyway, N2CMS is highly optimized and runs on NHibernate which has its own caching mechanism too, so go ahead with fetching site tree.

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