Sharepoint 通过编程创建站点导航
我在 sharepoint 中有一个要求,我想根据 Excel 文件创建顶部链接导航。意味着站点导航结构(以及父站点下的父站点子站点)在 Excel 文件中提及。我需要阅读该结构并基于修改共享点中的导航。
请任何人告诉我是否可以以这种方式配置导航。如果是,请告诉我如何实现它。
仅供参考:我正在使用 MOSS 2007。
提前感谢
sachin katkar
I have a requirement in sharepoint where I want to Create the top link navigation based on excel file. Means The site navigation structure (along with parent site subsite under parent site) is mention in excel file. I need to read that structure and based on modify the navigation in sharepoint.
Please can any one tell me is it possible to configure navigation in such a way. If yes then please tell me how to achive it.
FYI: I am using MOSS 2007.
thanks in advance
sachin katkar
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
如果这是一个发布网站,您可以使用类似于以下的代码:
If this is a Publishing site, you can use code similar to the following:
是的,你可以做到这一点。
我也有几乎相同的要求。我通过以下方式完成了此任务
如果您需要更多帮助,请问我,我可以帮助您
yes you can do this.
I had also almost the same requirement. I did this task by the following way
If you want more help, pls ask me, I can help you
哇,这似乎是一个非常糟糕的主意。为什么不使用 SharePoint 列表来填充静态菜单?创建更容易,速度更快,因为它不需要打开 Excel 工作表,并且您可以根据需要从 Excel 工作表复制并粘贴值。
或者,我使用 Excel 工作表收集有关 SharePoint 网站结构的数据,例如哪些网站、模板和子网站等。从该 Excel 工作表中,我生成一个脚本,使用 http://stsadm.blogspot.com
这样,您的菜单将遵循 Excel 工作表的数据,并且不会有笨重的自定义代码。
Wow that seems like a really bad idea. Why not use a SharePoint list to populate a static menu with? Much easier to create, much faster because it does not need to open an Excel sheet, and you can copy and paste values in from an Excel sheet if you like.
Alternatively, I use excel sheets to gather data about the structure of a SharePoint site, e.g. what sites, template and subsites, etc. From that Excel sheet I generate a script to build a site structure using the commands in http://stsadm.blogspot.com
This way, your menu will follow the Excel sheet's data and there will be no clunky custom code.
有两种方法可以实现此目的 - 在现有 SharePoint 导航结构中添加/删除节点,或者更改菜单控件使用的数据源。
要修改标准导航设置(导航自定义继续像通常开箱即用的那样工作),请使用
另一个选项上的方法,包括编辑母版页(或适当的委托控件)并更改 AspMenu 和 SiteMapDataSource 元素以使用不同的站点地图提供者。您可以创建自己的实现,也可以使用从 xml 文件读取的开箱即用的实现。如果您选择此选项,用户将无法通过导航设置编辑菜单。
There are two ways you could implement this - either add/remove nodes within the existing SharePoint navigation structure, or change the data source used by the menu control.
To modify the standard navigation settings (navivagation customization continues to work as it usually does out of the box) use the methods on
The other option involves editing the master page (or appropriate delegate controls) and changing the AspMenu and SiteMapDataSource elements to use a different SiteMapProvider. You can either create your own implementation or use the out of box one that reads from an xml file. If you choose this option the user will not be able to edit the menus through navigation settings.