[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

Drop Down Navigation in SharePoint Foundation 2010

Posted on 2011-02-25
13
Medium Priority
?
2,784 Views
Last Modified: 2012-05-11
I found a workaround to creating drop down navigation in SharePoint Foundation 2010. As far as I can tell, this is not an available feature in the free version (I believe you have to enable publishing for this option to appear). The work around worked, but, now the parent page (home page) does not appear in the navigation bar. It appears to be hiding the parent and displaying the children. I can't find anywhere to allow the parent to display. The code I used for the workaround is as follows:

I created a new data connection and gave it the default name of SiteMapDataSource1.

<SharePoint:AspMenu
        ID="SPSiteMapProvider"
        Runat="server"
        EnableViewState="False"
        DataSourceID="SiteMapDataSource1"
        AccessKey="<%$Resources:wss,navigation_accesskey%>"
        UseSimpleRendering="True"
        UseSeparateCss="False"
        Orientation="Horizontal"
        StaticDisplayLevels="2"
        MaximumDynamicDisplayLevels="2"
        SkipLinkText=""
        CssClass="s4-tn"/>
      <asp:SiteMapDataSource runat="server" ID="SiteMapDataSource1"/>
      <SharePoint:DelegateControl runat="server" ControlId="TopNavigationDataSource" Id="topNavigationDelegate">
            <Template_Controls>
                  <asp:SiteMapDataSource
                    ShowStartingNode="True"
                    SiteMapProvider="SPSiteMapProvider"
                    id="topSiteMap"
                    runat="server"
                    StartingNodeUrl="sid:1002"/>
            </Template_Controls>
      </SharePoint:DelegateControl>

There is a class being called named .ms-hidden. It seems to be the culprit. Instead of Home on the menu bar it is placing the text "currently selected" (if I put in a lot of dirty code to make it show up at all).

Any help would be greatly appreciated. Thanks.
0
Comment
Question by:whitlockit
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 8
  • 3
13 Comments
 

Author Comment

by:whitlockit
ID: 34997001
Thanks
0
 
LVL 14

Expert Comment

by:GeorgeGergues
ID: 34998415
Can you check the Site Settings  -> Navigation and select the Use Parent

Also Check if you can point to the parent Style Sheet under ( Custom Style Sheet)


Best of luck.
0
 

Author Comment

by:whitlockit
ID: 34998731
I am in the free version of SharePoint 2010 (Foundations). I believe the navigation option (tab) is only available in Server 2010 (appears when publishing is enabled). If I'm wrong on that, then I am just blind and can't locate the tab, lol.
0
Get your Disaster Recovery as a Service basics

Disaster Recovery as a Service is one go-to solution that revolutionizes DR planning. Implementing DRaaS could be an efficient process, easily accessible to non-DR experts. Learn about monitoring, testing, executing failovers and failbacks to ensure a "healthy" DR environment.

 
LVL 14

Expert Comment

by:GeorgeGergues
ID: 34999229
You are correct,

Under look and feel , you can see the Top Nav Bar and the Quick launch for customization only.

no dynamic menus here.

I am so used to MOSS in fact mostly Enterprise features too.


I don't think there is an easy way out .

but you can build a navigation menu  with Silverlight rather than the SPnavigation Provider


Here is a question for you .

On that application's web.config do you see a line mentioning anything about
<SiteMap defaultProvider= xxxxxxxx>


See the Control name and if that is enabled.

in fact it might be a good idea to share your web.config , only for that application

Thanks

0
 

Author Comment

by:whitlockit
ID: 34999345
I did find that in the web.config:

<siteMap defaultProvider="SPSiteMapProvider" enabled="true">
      <providers>
        <add name="SPNavigationProvider" type="Microsoft.SharePoint.Navigation.SPNavigationProvider, Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" />
        <add name="SPSiteMapProvider" type="Microsoft.SharePoint.Navigation.SPSiteMapProvider, Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" />
        <add name="SPContentMapProvider" type="Microsoft.SharePoint.Navigation.SPContentMapProvider, Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" />
        <add name="SPXmlContentMapProvider" siteMapFile="_app_bin/layouts.sitemap" type="Microsoft.SharePoint.Navigation.SPXmlContentMapProvider, Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" />
      </providers>
    </siteMap>

The entire file was very large so I just posted the excerpt you referred to. If you need me I would be happy to provide it. Currently, I have been working on using jquery to rebuild the links after SharePoint renders them. I don't know enough about Silverlight to create menus with that. I would just rip out the menus all together and create my own, but, if a user creates a new site I need it to show up without having to manually enter the new link (if that makes any sense). Huge pain in the but, but, I haven't been able to come up with any better alternatives. Thanks.
0
 

Author Comment

by:whitlockit
ID: 34999359
If you need more, not need me, lol. Typo
0
 
LVL 14

Expert Comment

by:GeorgeGergues
ID: 34999545
that is correct setting for foundation .

you can make this change.
UseSeparateCSS ="True" and Inherit that sheet on your master page .


   UseSimpleRendering="True"
       UseSeparateCss="False"
        Orientation="Horizontal"
        StaticDisplayLevels="2"
        MaximumDynamicDisplayLevels="2"


I am out of ideas , Sorry , but hope that puts you in the right direction.
0
 

Author Comment

by:whitlockit
ID: 34999649
I am using a seperate css. I have no problem overwriting the styles. The problem is, when I enabled multi level menus, it assigns an extra <span> tag with a class of .ms-hidden to whatever is currently selected. The root page (home) appears as "Currently Selected" in the menu bar. If I click on a different page, nothing appears in the menu bar (where "Home" should display) and the words "Currently Selected" appear under whichever link I have just clicked on. It's very odd. Hope that is not an overly convoluted explanation. I have provided two screenshots for easier explanation.

 On the home page On the second page
0
 

Author Comment

by:whitlockit
ID: 34999740
I appreciate the help @GeorgeGerques. Hacking up these menus will be the death of me, lol.
0
 

Accepted Solution

by:
whitlockit earned 0 total points
ID: 35000787
In case someone else poses this question, I worked around the problem. Let SharePoint render the menu (so that you get the pages in your site collection/this will take into account any new pages created). Once the menu generates, I use an if statement in JQuery to find and remove the <span> tag containing the .ms-hidden class. Then, using JQuery, I overwrite the styles that SharePoint applied to the menu bar. I overwrite the styles using JQuery because for some reason, the currently selected page on the menu bar will not accept the styles in my style sheet. I know this sounds like a huge pain, but, it works and involved much less code than I originally expected. If anyone finds a better solution to this problem, let me know. Thanks for the help.
0
 

Author Closing Comment

by:whitlockit
ID: 35042730
This was my solution
0

Featured Post

Looking for a new Web Host?

Lunarpages' assortment of hosting products and solutions ensure a perfect fit for anyone looking to get their vision or products to market. Our award winning customer support and 30-day money back guarantee show the pride we take in being the industry's premier MSP.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Originally, this post was published on Monitis Blog, you can check it here . It goes without saying that technology has transformed society and the very nature of how we live, work, and communicate in ways that would’ve been incomprehensible 5 ye…
This article helps those who get the 0xc004d307 error when trying to rearm (reset the license) Office 2013 in a Virtual Desktop Infrastructure (VDI) and/or those trying to prep the master image for Microsoft Key Management (KMS) activation. (i.e.- C…
The viewer will learn how to  create a slide that will launch other presentations in Microsoft PowerPoint. In the finished slide, each item launches a new PowerPoint presentation and when each is finished it automatically comes back to this slide: …
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

650 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question