Don't display the current collection in the top nav bar
-
lunedì 16 agosto 2010 14:44
Hi,
I have the following topnavbar :
HOME | FIRM | Market 1 | Market 2 | Market 3
When I'm in Market 2 , you know what happens :
Market 2 | HOME | FIRM | Market 1 | Market 2 | Market 3
I want the first Market 2 to disappear.
I found the followind code in different threads (MOSS 07) to input in CSS :
td#zz1_TopNavigationMenun0 {
display:none;
}But I've no idea where I should paste this code. I just found a jungle of CSS files in 14\template\layouts\1036\styles.
Moreover, it would be great to highlight the last Market 3 , as the first before he was deleted, in order to keep a good navigation experience.
Thank you a lot !
Tutte le risposte
-
lunedì 16 agosto 2010 16:22
Why do you see Market 2 as root node? Is this dedicated site collection?
-
martedì 17 agosto 2010 06:52
Yes, all links are different root site collections. (I had to set up this top link bar for each collection...)
To precise more :
I want this top link bar for each site collection :
HOME | FIRM | Market 1 | Market 2 | Market 3
Until this day, I used to delete the link of the collection where I am because it automatically appears first :
ex in the Market 1 :
Market 1 (the automatically one) | HOME | FIRM | Market 2 | Market 3
And the same way where I am in Home :
HOME (the automatically one) | FIRM | Market 1 | Market 2 | Market 3
This way was satisfactory because all links pointed at the root site collections but now it's no more.
Is there a way at least to modify the link of the current root site collection (the automatically one) ? It could be a solution for me.
Thanks
-
martedì 17 agosto 2010 09:20
Perhaps you can use the example in the following: http://msdn.microsoft.com/EN-US/library/2cdy75y0 to make your navigation show 0 static and 0 dynamic, then add the item you want yourself on all the masterpages for the sitecollections you want to show this navigation.
Something like:
Hope this helps<items> <asp:menuitem navigateurl="Home.aspx" text="Home" tooltip="Home"> <asp:menuitem navigateurl="Music.aspx" text="Music" tooltip="Music"> <asp:menuitem navigateurl="Classical.aspx" text="Classical" tooltip="Classical"/> <asp:menuitem navigateurl="Rock.aspx" text="Rock" tooltip="Rock"/> <asp:menuitem navigateurl="Jazz.aspx" text="Jazz" tooltip="Jazz"/> </asp:menuitem> <asp:menuitem navigateurl="Movies.aspx" text="Movies" tooltip="Movies"> <asp:menuitem navigateurl="Action.aspx" text="Action" tooltip="Action"/> <asp:menuitem navigateurl="Drama.aspx" text="Drama" tooltip="Drama"/> <asp:menuitem navigateurl="Musical.aspx" text="Musical" tooltip="Musical"/> </asp:menuitem> </asp:menuitem> </items>
Thomas Balkeståhl - Technical Specialist - SharePoint -
martedì 17 agosto 2010 09:29
<items> <asp:menuitem navigateurl="/home/default.aspx" text="HOME" tooltip="Home"> </asp:menuitem> <asp:menuitem navigateurl="/firm/default.aspx" text="FIRM" tooltip="Firm"> </asp:menuitem> <asp:menuitem navigateurl="/market1/default.aspx" text="Market1" tooltip="Market1"> </asp:menuitem> <asp:menuitem navigateurl="/market2/default.aspx" text="Market2" tooltip="Market2"> </asp:menuitem> </items>
Something like this....
Thomas Balkeståhl - Technical Specialist - SharePoint -
martedì 17 agosto 2010 10:36
Thank you for your help
This could be a solution but I should lose the TopLinkBar's advantages (the visual, the inheritance - unless I set a inheritance of masterpages in site collection... that seems hard to do for me).
Nevertheless, any modification could be quickly copy/page through collections... But all links are already configured in all site collections, and I should learn how to personalize the items'designs. It may take a long time.
I'm sure there's an easier way.
On the other hand, it's perfect for my left Quicklaunch ! I was wondering how to create dynamics items ! Thanks a lot !
(Please excuse my english language)
Guillaume
-
martedì 17 agosto 2010 11:30
Hey, Sorry I just forgot one thing but here it is...
You can use these 3 in combination to achive what you want here, I think...:-)
StartingNodeOffset
ShowStartingNode
StartFromCurrentNodeDo a web search on them and I hope that you will be ok.
In my own custom navigation on the sublevels, I start from 1 and show 3 static and 10 dynamic. That in the master, the rest I handle in the site settings, navigation settings.
Regards
Thomas Balkeståhl - Technical Specialist - SharePoint -
martedì 17 agosto 2010 12:16Is this SharePoint Foundation or SharePoint Server?
John Ross
SharePoint Server MVP | Sr. Consultant SharePoint911: SharePoint Consulting
Blog: http://www.sharepoint911.com/blogs/john
Twitter: @JohnRossJr
Professional SharePoint 2010 Branding and User Interface Design -
martedì 17 agosto 2010 12:28
Sharepoint Server ! Sorry, oversight
I'm going to see that Balken !
-
martedì 17 agosto 2010 13:10
Well my point here is that if you look at the navigation provider used in nightandday.master you'll notice it doesn't include the root node link in the navigation. All you'd need to do is reference the same navigation control in your master page. You'd be able to achieve what you want without having to hard code anything.
[Edit] Just realize this was cross site collection navigation. In this case check out this post:
http://blah.winsmarts.com/2010-5-Security_Trimmed_Cross_Site_Collection_Navigation.aspx
John Ross
SharePoint Server MVP | Sr. Consultant SharePoint911: SharePoint Consulting
Blog: http://www.sharepoint911.com/blogs/john
Twitter: @JohnRossJr
Professional SharePoint 2010 Branding and User Interface Design -
martedì 17 agosto 2010 15:08Does it work if my Collections Sites are in differents Web Applications ? I did not gave that precision because I am just realizing it could change everything...
-
martedì 17 agosto 2010 15:25I honestly don't know. I haven't specifically tried the solution. Was there a specific reason why these site collections were in different web applications? There are some challenges to this approach especially if users are to be hopping between web applications.
John Ross
SharePoint Server MVP | Sr. Consultant SharePoint911: SharePoint Consulting
Blog: http://www.sharepoint911.com/blogs/john
Twitter: @JohnRossJr
Professional SharePoint 2010 Branding and User Interface Design -
martedì 17 agosto 2010 15:44
If you are using static menu items, they could as well be external or whatever...
For dynamic items, they have as far as I know to be within the same Site Collection, a demand which you have already broken...;-)
regards
Thomas Balkeståhl - Technical Specialist - SharePoint -
martedì 17 agosto 2010 16:20
Balken-
Whether they are static or not -- hopping between web applications means a user is hopping between security zones which would require re-authentication potentially.
Another solution that I've seen to this issue is to do a custom navigation which derives from search and can easily cross site collections as well as web applications.
John Ross
SharePoint Server MVP | Sr. Consultant SharePoint911: SharePoint Consulting
Blog: http://www.sharepoint911.com/blogs/john
Twitter: @JohnRossJr
Professional SharePoint 2010 Branding and User Interface Design -
mercoledì 18 agosto 2010 15:01
HI,
First of all, thank you for helping me.
John Ross -
We chose to set defferent web applications in order to have several SQL databases which will be devided into several servers.
I agree this approach isn't with some challenges ! And we may meet with others problems in the future.
I found a solution for my problem :
Here's the code I found in Yahoo and that I have modified a little. It replace the AspMenu and the DelegateControl from the MasterPage :
<%@ Register Tagprefix="PublishingNavigation" Namespace="Microsoft.SharePoint.Publishing.Navigation" Assembly="Microsoft.SharePoint.Publishing, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> <SharePoint:AspMenu ID="TopNavigationMenuV4" Runat="server" EnableViewState="false" DataSourceID="TopMenuNoHome" AccessKey="<%$Resources:wss,navigation_accesskey%>" UseSimpleRendering="true" UseSeparateCss="false" StaticDisplayLevels="1" Orientation="Horizontal" MaximumDynamicDisplayLevels="2" SkipLinkText="" CssClass="s4-tn"/> <PublishingNavigation:PortalSiteMapDataSource ID="TopMenuNoHome" Runat="server" SiteMapProvider="CombinedNavSiteMapProvider" EnableViewState="true" StartFromCurrentNode="true" StartingNodeOffset="0" ShowStartingNode="False" TreatStartingNodeAsCurrent="true" TrimNonCurrentTypes="Heading"/>
It's working with my different pages and libraries.However, it is not affecting the site settings pages and the page "view all site content".
That's why I am seeking how to affect theses pages.
Regards
-
giovedì 19 agosto 2010 00:56
First off -- you can have separate SQL dbs for each site collections without needing to have separate web applications.
It looks like the solution you've decided is pretty much to replicate what the navigation control in nightandday.master does which doesn't show the root node. That's definitely fine is the plan is to manually create your navigation. I'd prefer this approach over the hardcoding of the navigation as suggested earlier in the thread. Definitely a fairly simple and clean approach -- it just means you'll have to manually manage the navigation at the top of each site collection to keep it in synch.
John Ross
SharePoint Server MVP | Sr. Consultant SharePoint911: SharePoint Consulting
Blog: http://www.sharepoint911.com/blogs/john
Twitter: @JohnRossJr
Professional SharePoint 2010 Branding and User Interface Design -
giovedì 19 agosto 2010 15:23
Too late... We'll have to play with difficulties !
Yes, manually ! We have only 6 web applications (and collections so) to display on the top link bar that's why the manual way to manage the navigation is not too long.
I have still a problem with settings pages (those which are in _layouts).
I've tried to understand how viewlsts.aspx and areanavigationsettings.aspx work for example.
They are linked to masterpage like this : DynamicMasterPageFile="~masterurl/default.master"
I have still not understood where is this default.master and how does it work. Because when I delete default.master of layout and all the other master pages, it changes nothing to the display of the settings pages.
I've checked the application.master and the applicationv4.master and it seems to refer the TopNavBar.ascx in CONTROLTEMPLATES.
The code which is in this is :
<%@ Control Language="C#" compilationMode="Always" %> <%@ Register Tagprefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> <%@ Register Tagprefix="Utilities" Namespace="Microsoft.SharePoint.Utilities" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> <%@ Import Namespace="Microsoft.SharePoint" %> <%@ Assembly Name="Microsoft.Web.CommandUI, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> <script runat="server"> private bool m_bShouldUseExtra; private int m_ver = 3; public bool ShouldUseExtra { get { return m_bShouldUseExtra; } set { m_bShouldUseExtra = value; } } public int Version { get { return m_ver;} set { m_ver = value; } } </script> <% SPWeb web = SPControl.GetContextWeb(Context); string alternateHeader = web.AlternateHeader; if (alternateHeader == null || alternateHeader == "") { if (web.UIVersion == 3) { %> <!--Top bar--> <table class="ms-bannerframe" border="0" cellspacing="0" cellpadding="0" width="100%"> <tr> <td nowrap="nowrap" valign="middle"></td> <td class="ms-banner" width="99%" nowrap="nowrap" id="HBN100" valign="middle"> <!--webbot Bot="Navigation" startspan--> <% if (m_bShouldUseExtra == true ) { %> <SharePoint:AspMenu ID="TopNavigationMenu" Runat="server" DataSourceID="topSiteMap" EnableViewState="false" AccessKey="<%$Resources:wss,navigation_accesskey%>" Orientation="Horizontal" StaticDisplayLevels="2" MaximumDynamicDisplayLevels="1" DynamicHorizontalOffset="0" StaticPopoutImageUrl="/_layouts/images/menudark.gif" StaticPopoutImageTextFormatString="" DynamicHoverStyle-BackColor="#CBE3F0" SkipLinkText="" StaticSubMenuIndent="0" CssClass="ms-topNavContainer"> <StaticMenuStyle/> <StaticMenuItemStyle CssClass="ms-topnav" ItemSpacing="0px"/> <StaticSelectedStyle CssClass="ms-topnavselected" /> <StaticHoverStyle CssClass="ms-topNavHover" /> <DynamicMenuStyle BackColor="#F2F3F4" BorderColor="#A7B4CE" BorderWidth="1px"/> <DynamicMenuItemStyle CssClass="ms-topNavFlyOuts"/> <DynamicHoverStyle CssClass="ms-topNavFlyOutsHover"/> <DynamicSelectedStyle CssClass="ms-topNavFlyOutsSelected"/> </SharePoint:AspMenu> <SharePoint:DelegateControl runat="server" ControlId="TopNavigationDataSource" Id="topNavigationDelegate"> <Template_Controls> <asp:SiteMapDataSource ShowStartingNode="False" SiteMapProvider="SPNavigationProvider" id="topSiteMap" runat="server" StartingNodeUrl="sid:1002"/> </Template_Controls> </SharePoint:DelegateControl> <% } else { %>  <SharePoint:Navigation LinkBarId="1002" runat="server" Id="linkbar1002"/> <% } %> </td> <td class="ms-banner">  </td> <td valign="bottom" align="right"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td> <table height="100%" class="ms-siteaction" cellpadding="0" cellspacing="0"> <tr> <SharePoint:SiteActions runat="server" accesskey="<%$Resources:wss,tb_SiteActions_AK%>" id="SiteActionsMenu" PrefixHtml="<td class="ms-siteactionsmenu"><div><div>" SuffixHtml="</div></div></td>" > <CustomTemplate> <SharePoint:FeatureMenuTemplate runat="server" FeatureScope="Site" Location="Microsoft.SharePoint.StandardMenu" GroupId="SiteActions" UseShortId="true" > <SharePoint:MenuItemTemplate runat="server" id="MenuItem_Create" Text="<%$Resources:wss,viewlsts_pagetitle_create%>" Description="<%$Resources:wss,siteactions_createdescription%>" ImageUrl="/_layouts/images/Actionscreate.gif" MenuGroupId="100" Sequence="100" UseShortId="true" ClientOnClickScriptContainingPrefixedUrl="if (LaunchCreateHandler('All')) { STSNavigate('~site/_layouts/create.aspx') }" PermissionsString="ManageLists, ManageSubwebs" PermissionMode="Any" /> <SharePoint:MenuItemTemplate runat="server" id="MenuItem_Settings" Text="<%$Resources:wss,settings_pagetitle%>" Description="<%$Resources:wss,siteactions_sitesettingsdescription%>" ImageUrl="/_layouts/images/ActionsSettings.gif" MenuGroupId="100" Sequence="300" UseShortId="true" ClientOnClickNavigateUrl="~site/_layouts/settings.aspx" PermissionsString="EnumeratePermissions,ManageWeb,ManageSubwebs,AddAndCustomizePages,ApplyThemeAndBorder,ManageAlerts,ManageLists,ViewUsageData" PermissionMode="Any" /> <SharePoint:MenuItemTemplate runat="server" id="MenuItem_SitePermissions" Text="<%$Resources:wss,people_sitepermissions%>" Description="<%$Resources:wss,siteactions_sitepermissiondescription%>" ImageUrl="/_layouts/images/placeholder32x32.png" MenuGroupId="100" Sequence="500" UseShortId="true" ClientOnClickNavigateUrl="~site/_layouts/user.aspx" PermissionsString="EnumeratePermissions" PermissionMode="Any" /> </SharePoint:FeatureMenuTemplate> </CustomTemplate> </SharePoint:SiteActions> </tr> </table> </td> </tr> </table> </td> </tr> </table> <% } else { if (m_bShouldUseExtra == true ) { %> <SharePoint:AspMenu ID="TopNavigationMenuV4" Runat="server" EnableViewState="false" DataSourceID="topSiteMap" AccessKey="<%$Resources:wss,navigation_accesskey%>" UseSimpleRendering="true" UseSeparateCss="false" Orientation="Horizontal" StaticDisplayLevels="2" MaximumDynamicDisplayLevels="1" SkipLinkText="" CssClass="s4-tn" /> <% } else { %>  <SharePoint:Navigation LinkBarId="1002" runat="server" Id="linkbar1002_1" /> <% } } } else { %> <table border="0" cellspacing="0" cellpadding="0" width="100%"> <% if (!alternateHeader.StartsWith("/")) alternateHeader = "/_layouts/" + web.Language.ToString(System.Globalization.CultureInfo.InvariantCulture) + "/" + alternateHeader; Server.Execute(alternateHeader); %> </table> <% } %>
Sorry for this long code.
So I don't know where to put my code and how to adapt it (I'm not a developer). When I copy paste it with the same method as in v4.master, it says that TopNavigationV4 is already used (or already exist)
May I create a new thread for this question ??
-
venerdì 20 agosto 2010 14:28
Hi all !
Problem solved !
In TopNavBar.ascx I had the
<%@ Register Tagprefix="PublishingNavi....And then in the second
if (m_bShouldUseExtra == true ) { %>
I have set:
if (m_bShouldUseExtra == true ) { %> <SharePoint:AspMenu ID="TopNavigationMenuV4" Runat="server" EnableViewState="false" DataSourceID="TopMenuNoHome" AccessKey="<%$Resources:wss,navigation_accesskey%>" UseSimpleRendering="true" UseSeparateCss="false" Orientation="Horizontal" StaticDisplayLevels="1" MaximumDynamicDisplayLevels="1" SkipLinkText="" CssClass="s4-tn" /> <PublishingNavigation:PortalSiteMapDataSource ID="TopMenuNoHome" Runat="server" SiteMapProvider="CombinedNavSiteMapProvider" EnableViewState="true" StartFromCurrentNode="true" StartingNodeOffset="0" ShowStartingNode="False" TreatStartingNodeAsCurrent="true" TrimNonCurrentTypes="Heading"/> <% } else { %> ......
Thanks to all !
Guillaume

