3

I have added the table of content web part on my site.but I am getting site content for news Blog.How to resolve this.I don't want to get site content for a news blog.

please suggest some idea.

  • Try hiding it in the navigation – Praveena May 2 '17 at 14:36
3

It could be achieved by customizing Table Of Contents web part.

Table Of Contents web part is XSL based web part, the following table lists and describes the two XSL files that describe the Table Of Contents Web Part:

TableOfContentsMain.xsl

Location: \Style Library\XSL Style Sheets\TableOfContentsMain.xsl

Description:

  • Contains logic that generates the appropriate nodes.

  • Contains functions that help designers modify the Level transforms.

  • Receives all the content, parses it, and sends appropriate pieces to the LevelStyle template.

  • Maintains the structure of the Table of Content Web Part.

LevelStyle.xsl

Location: \Style Library\XSL Style Sheets\LevelStyle.xsl

Description: Contains templates that define how to display a level.

How to render site structure using Table Of Contents web part

Since it is not recommended to modify SharePoint out-of-the-box XSL files, we will create a custom file named SiteLevelStyle.xsl (copy of LevelStyle.xsl)

Solution: in order to exclude nodes except site nodes we are going to modify node-template template in SiteLevelStyle.xsl

To render only site nodes you could use the following code (filter to exclude non site nodes):

<xsl:if test="string-length(@Path) > 0 and not(contains(@Path, 'viewlsts.aspx')) and not(contains(@Path, '/Lists/')) and not(contains(@Path, '/Forms/')) and not(contains(@Path, 'WopiFrame.aspx')) and (@Title != 'Home') and (@Title != 'Recent') ">

  <!-- remaining code from node-template goes here... --> 


</xsl:if>

You could grab the final SiteLevelStyle.xsl file from here

How to apply changes

  • Upload SiteLevelStyle.xsl into Style Library (/Style Library/XSL Style Sheets/)

  • Export Table Of Contents web part

  • Open web part file and specify property ItemXslLink value to /Style
    Library/XSL Style Sheets/SiteLevelStyle.xsl

  • Upload the modified web part file and add imported web part on page

Please refer https://stackoverflow.com/questions/22909815/how-to-make-something-like-area-contents-in-sharepoint-2013?answertab=oldest#tab-top

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.