SharePoint 2013 – Customize Followed Sites/Documents Left Navigation

Left Navigation (Quick Lanuch)

In personal site, there are several pages are hidden which cannot be viewed through /_layouts/15/sitemanager.aspx; such as /Social/Sites.aspx and /Social/FollowedContent.aspx.

These two pages have delegated SiteMapProvider defined on the page. (C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\15\TEMPLATE\FEATURES\SocialDataStore\SocialDataStoreList)

Sites.aspx ==> MySiteSitesPageStaticProvider

which will only show “Followed Sites” on the left nav

<asp:SiteMapDataSource SiteMapProvider=”MySiteSitesPageStaticProvider” ShowStartingNode=”False”

id=”QuickLaunchSiteMap” StartingNodeUrl=”sid:1025″ runat=”server” />

FollowedContent.aspx ==> MySiteDocumentStaticProvider

which will only show “Followed Documents” on the left nav

<asp:SiteMapDataSource SiteMapProvider=”MySiteDocumentStaticProvider” ShowStartingNode=”False”

id=”QuickLaunchSiteMap” StartingNodeUrl=”sid:1025″ runat=”server” />

Our requirement is to make the left navigation show consistently. Here is our solution:

(1) Replace the static provider with MySiteHostQuickLaunchProvder, which will show all the quick launch items defined in MySiteHost.

<asp:SiteMapDataSource SiteMapProvider=”MySiteHostQuickLaunchProvider” ShowStartingNode=”False”

id=”QuickLaunchSiteMap” StartingNodeUrl=”sid:1025″ runat=”server” />

(2) Add MySiteQuickLaunch after V4QuickLaunchMenu, which will show all the quick launch items defined in personal site.

The result of PlaceHoderLeftNavBar will be :

<asp:Content ContentPlaceHolderId="PlaceHolderLeftNavBar" runat="server">
<a name="startNavigation"></a>
<div class="ms-core-sideNavBox-removeLeftMargin">
<SharePoint:SPNavigationManager
id="QuickLaunchNavigationManager"
runat="server"
QuickLaunchControlId="V4QuickLaunchMenu"
ContainedControl="QuickLaunch"
EnableViewState="false">
<asp:SiteMapDataSource
           SiteMapProvider="MySiteHostQuickLaunchProvider"
           ShowStartingNode="False"
           id="QuickLaunchSiteMap"
           StartingNodeUrl="sid:1025"
           runat="server" />
<SharePoint:AspMenu
id="V4QuickLaunchMenu"
runat="server"
EnableViewState="false"
DataSourceId="QuickLaunchSiteMap"
UseSimpleRendering="true"
Orientation="Vertical"
StaticDisplayLevels="1"
AdjustForShowStartingNode="true"
MaximumDynamicDisplayLevels="0"
SkipLinkText=""
/>
<div id="js-mysite-userquicklaunch">
<SharePoint:DelegateControl ID="DelegateControl6" runat="server" ControlId="MySiteUserQLDataSource">
<Template_Controls>
<asp:SiteMapDataSource SiteMapProvider="SPNavigationProvider"
                       ShowStartingNode="False"
                       id="MySiteUserQLSiteMap"
                       StartingNodeUrl="sid:1025"
                       runat="server" />
</Template_Controls>
</SharePoint:DelegateControl>
<ContentTemplate>
<SharePoint:AspMenu id="MySiteUserQLMenu" runat="server"
EnableViewState="false" DataSourceId="MySiteUserQLSiteMap" UseSimpleRendering="true"
UseSeparateCss="false" Orientation="Vertical" StaticDisplayLevels="2"
MaximumDynamicDisplayLevels="0" SkipLinkText="" />
</ContentTemplate>
</div>
</SharePoint:SPNavigationManager>
</div>
</asp:Content>

(3) Rename these pages – **.aspx and deploy it to replace the OOTB pages through CSOM or SSOM. Refer to my post for code example:

https://lixuan0125.wordpress.com/2013/08/15/overwrite-the-site-page-with-custom-page-sharepoint-2013/

 
Advertisements

One thought on “SharePoint 2013 – Customize Followed Sites/Documents Left Navigation

  1. Can you provide some inputs on how to Update SiteMapProvider in ‘followedcontent.aspx’ page.It will be of great help.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s