简体   繁体   English

在Sharepoint AspMenu控件中显示分隔符

[英]Display separator in Sharepoint AspMenu control

All I'm trying to do is display a separator (I've tried images & stylesheets) between the primary navigation menu items in Sharepoint. 我要做的就是在Sharepoint的主要导航菜单项之间显示一个分隔符(我已经尝试过图像和样式表)。 Here is what I want it to look like: 这是我想要的样子:

Home | Menu1 | Menu2 | Menu3

When I attempt to use the StaticTopSeparatorImageUrl (using a bar image) it results in the following: 当我尝试使用StaticTopSeparatorImageUrl(使用条形图)时,结果如下:

Home | Menu1 | Menu2 | Menu3 |

This is obviously not a separator, and when I use the StaticBottomSeparatorImageUrl the opposite happens. 这显然不是分隔符,当我使用StaticBottomSeparatorImageUrl时,情况正好相反。 I also tried to style the ms-topnav class to have a left border, which doesn't work because the control doesn't identify the first (or last) item in the menu... 我还尝试将ms-topnav类的样式设置为具有左边框,这不起作用,因为控件无法识别菜单中的第一个(或最后一个)项目。

So, my next option was to use the Telerik RadMenu, after fighting to get it into Sharepoint I had difficulties getting it to display like the Sharepoint Menu using the SiteMapDataSource (display only the Home item and no children). 因此,我的下一个选择是使用Telerik RadMenu,在争取使其进入Sharepoint后,我很难使用SiteMapDataSource使它像Sharepoint Menu一样显示(仅显示Home项目,不显示子项)。

This seems SO simple, but it is Sharepoint, so nothing is really simple. 这似乎很简单,但是它是Sharepoint,所以没有什么是真正简单的。 I'm wondering if there is either a way to make the default Sharepoint separator work correctly that I might have missed, or is there a GOOD Sharepoint menu replacement that actually takes styling into account? 我想知道是否有一种方法可以使我可能会错过的默认Sharepoint分隔符正常工作,或者是否存在实际上考虑了样式的GOOD Sharepoint菜单替换?

I prefer to inherit from the MossMenu that the SharePoint team released and customise the menu to producte exactly the html I want. 我更喜欢从SharePoint团队发布的MossMenu继承,并自定义菜单以完全生产所需的html。

http://blogs.msdn.com/sharepoint/archive/2006/12/02/customizing-the-wss-3-0-moss-2007-menu-control.aspx http://blogs.msdn.com/sharepoint/archive/2006/12/02/customizing-the-wss-3-0-moss-2007-menu-control.aspx

The instructions for deployment here should help. 此处的部署说明应该会有所帮助。

  1. Take the Microsoft.SDK.SharePointServer.Samples.dll and put it in the GAC. 将Microsoft.SDK.SharePointServer.Samples.dll放入GAC。
  2. Edit the web.config file and add in the following SafeControls entry: 编辑web.config文件,并添加以下SafeControls条目:
  3. Copy the MossMenu.js file to \\12\\TEMPLATE\\LAYOUTS 将MossMenu.js文件复制到\\ 12 \\ TEMPLATE \\ LAYOUTS
  4. Edit your MasterPage with the following: <%@ Register Assembly="Microsoft.SDK.SharePointServer.Samples, Version=1.0.0.0, Culture=neutral, PublicKeyToken=6f07a0c27c74cfa1" Namespace="Microsoft.SDK.SharePointServer.Samples" TagPrefix="Sharepoint" %> 使用以下内容编辑您的母版页:<%@ Register Assembly =“ Microsoft.SDK.SharePointServer.Samples,Version = 1.0.0.0,Culture = neutral,PublicKeyToken = 6f07a0c27c74cfa1” Namespace =“ Microsoft.SDK.SharePointServer.Samples” TagPrefix =“共享点“%>
  5. Change the SharePoint:AspMenu tag with SharePoint:MossMenu. 使用SharePoint:MossMenu更改SharePoint:AspMenu标记。 Leave all the config tags the same. 保留所有配置标签相同。

The actual splitter or separator can be customised by overriding the background image that is set to the top right (no repeating) in the topNavItem in Core.css 可以通过覆盖Core.css中topNavItem中设置为右上角(无重复)的背景图像来自定义实际的拆分器或分隔符

Just change the image being referenced there. 只需更改在那里引用的图像即可。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM