通过功能部署自定义导航/站点地图?

发布于 2024-10-25 22:32:21 字数 915 浏览 1 评论 0 原文

您可以通过“站点设置”>“SP2010”自定义导航。导航:

在此处输入图像描述

我将如何继续自己定义一个简单的(!)导航并使用 via 功能进行部署?我真的不想创建自定义母版页 - 就像我通过前端所做的那样:向菜单添加两个链接,我很高兴。

我读到了有关 自定义站点地图提供程序 并使用 自定义 xml 文件并在 web.config 中引用它,但我不敢相信简单地修改全局导航中的一些现有链接并添加一些链接并不容易新的 - 基本上创建我自己的菜单。

让我们举个例子:

Global Navigation
    Custom Folder
        Products --> lists/products
        More News --> lists/morenews
        Entertainment --> lists/entertainment
    Another Folder
        Somethingelse --> somethingelse.aspx

我将如何将其部署到我的网站并替换全局导航?

You can customize the navigation in SP2010 via Site Settings > Navigation:

enter image description here

How would I go ahead and define a simple (!) navigation myself and deploy with via feature? I don't really want to create a custom master page - just like I would do via the frontend: Add two links to the menu and I'm happy.

I read about a custom site map provider and using a custom xml file and reference it in the web.config, but I cannot believe it is not easier to simply modify some existing links in the global navigation and add some new ones - basically create my own menu.

Let's go with an example:

Global Navigation
    Custom Folder
        Products --> lists/products
        More News --> lists/morenews
        Entertainment --> lists/entertainment
    Another Folder
        Somethingelse --> somethingelse.aspx

How would I go about and deploy this to my site and replace the global navigation?

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

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

发布评论

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

评论(3

你げ笑在眉眼 2024-11-01 22:32:21

原来我正在寻找 SPWeb.Navigation 属性。我可以使用 AddToQuickLaunch (MSDN) 方法。

Microsoft 甚至有一个 MSDN 条目来满足我正在寻找的内容: 添加链接到快速启动

步入正轨后,您会发现更多信息:

所以现在我只需通过功能接收器添加自定义导航即可,一切都很好。

Turns out I'm looking for the SPWeb.Navigation Property. I can easily add links to the global navigation and the quick launch by using the AddToQuickLaunch (MSDN) method.

Microsoft even has a MSDN entry for what I was looking for: Adding Links to Quick Launch.

Once you're on track you find more information:

So now I just have to add my custom navigation via a Feature Receiver and all is fine.

删除会话 2024-11-01 22:32:21

为此,一种选择是在母版页中使用 asp:repeaters 从全局导航中提取数据。首先,您需要在母版页中设置一些内容,以便从内置导航中提取数据(站点设置>导航)。然后您可以在母版页中根据需要设置其样式。因此,现在如果您在导航中添加更多条目,它们在导航中的显示将相同。

http://sharepoint2010customnavigation.blogspot.com/

In order to do this, one option would be to use asp:repeaters in the masterpage to pull in data from the global navigation. First you need to setup something in the masterpage that will pull in data from their built in navigation (site settings>navigation). Then you can style it however you want in the master page. So now if you add more entries into the navigation, they will appear the same in the navigation.

http://sharepoint2010customnavigation.blogspot.com/

携余温的黄昏 2024-11-01 22:32:21

我会为您的功能创建一个事件接收器来运行您需要的代码。
此处 和 < a href="http://www.novolocus.com/2008/10/16/updating-the-navigation-settings-in-a-publishing-site/" rel="nofollow">这里是几个帮助您入门的链接。

I would create an event receiver for your feature that runs the code you require.
Here and here are a couple of links to get you started.

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