Prevent SPAN tag in SharePoint Top Navigation Menu
-
יום חמישי 21 יוני 2012 07:04
I am using Publishing Site with Global Navigation
When I have seen the source code of page from browser.
I have found menu item generated like
<li class="static selected"> <a id="slink" href="/sites/mySite/Tool/default.aspx" class="static selected menu-item"> <span class="additional-background"> <span class="menu-item-text">Tool</span></span></a> </li>I want to remove span tags from menu item
final result should like given below
<li class="static selected"> <a id="slink" href="/sites/mySite/Tool/default.aspx" class="static selected menu-item"> Tool </a> </li>can you please suggest anything (not custom menu)....
Regards, Kashyap Patel http://interview-question-aspnet.blogspot.com
כל התגובות
-
יום שישי 22 יוני 2012 10:02מנחה דיון
-
שבת 23 יוני 2012 06:43
-
יום שני 25 יוני 2012 12:04
I am sure you could use a script to remove this. But why are you trying to remove this? The "additional-background" is used to show the dropdown arrow in the navigation. Also if you have a header without a link the text goes within the span tag. These span tags actually can come in handy with custom designs.
Heather Waterman SharePoint Branding and Desgin heatherwaterman.com @hwaterman
-
יום שלישי 26 יוני 2012 06:47
Thanks Everyone,
Finally solution found.
This method is not best way to do this which I am going to mention
- Find Microsoft.SharePoint.dll
- Decomplile with Reflector.NET
- Find File from Microsoft > SharePoint > WebControls > aspmenu.cs
- Copy this file to the your custom library
- Customize method BuidDefaultInnerItem(MenuItem item, HtmlWriter writer, StringBulder className)
- remove span generation tags
- Rename Menu <{0}:aspmenu ..... to yours
- Change to the master page, add reference and enjoy....
Regards, Kashyap Patel http://interview-question-aspnet.blogspot.com
- סומן כתשובה על-ידי Kashyap Patel יום שלישי 26 יוני 2012 06:47