Sharepoint:用于自定义列表的自定义 SiteMapProvider
我需要自定义 SiteMapNodes 的标题属性。
我正在使用 WSS,并创建了一个自定义文档库。 在浏览该库时,我想更改列表名称上方显示的面包屑中的节点名称。
到目前为止我已经:
- 创建了一个继承自的类 System.Web.SiteMapProvider,
- 将我的类添加到 web.config,
- 更改共享点 default.master page sitemappath(在 PlaceHolderTitleBreadcrumb) 指向 到我的新站点地图提供商。
然后,我覆盖了 CurrentNode 属性,以使用所需名称编辑 CurrentNode.title。
我的问题是所有以前的节点(父节点)都恢复为其原始名称。 如何编辑面包屑以便导航到的所有节点都保留其新标题?
任何建议或指导将不胜感激。
I need to customise the title property for SiteMapNodes.
I am using WSS, and have created a custom document library. While navigating through this library I want to change the names of the nodes in the breadcrumb displayed above the list name.
So far I have:
- created a class inheriting from
System.Web.SiteMapProvider, - added my class to the web.config,
- changed the sharepoint
default.master page sitemappath (in
PlaceHolderTitleBreadcrumb) to point
to my new site map provider.
I then overwrote the CurrentNode property to edit the CurrentNode.title with the desired name.
My problem is all the previous nodes (parent nodes) revert back to their original names. How do I edit the breadcrumb so that all the nodes navigated through keep their new title?
Any advice or direction would be appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我之前完成此操作的方法不是创建新的 SiteMapProvider,而是将密封的 SharePoint AspMenu 控件替换为 MossMenu (与 AspMenu 相同,但开源SharePoint 团队)。 然后我用我需要的行为覆盖 OnMenuItemDataBound 。
如果您需要/更喜欢使用 SiteMapProvider,您是否尝试过使用 Reflector 或新的.NET框架调试支持看看它是如何工作的? SiteMapProvider 代码中必须有某个地方您所覆盖的更改也被覆盖。 :-)
The way I've done this before isn't by creating a new SiteMapProvider, but by replacing the sealed SharePoint AspMenu control with MossMenu (the same as AspMenu but open sourced by the SharePoint team). I then overrode OnMenuItemDataBound with the behaviour I needed.
If you need/prefer to use SiteMapProvider, have you tried using Reflector or the new .NET Framework debugging support to see how it works? There must be somewhere in the SiteMapProvider code where your overridden changes are, in turn, also being overridden. :-)