none
Table of Contents Web Part: 3 Columns RRS feed

  • Question

  • Hi guys,

    I've noticed a small behavioural change in the Table of Contents Web Part between SharePoint 2007 and SharePoint 2013, namely the ability to set the display columns.  For some reason, this has been removed in SharePoint 2013

    SharePoint 2007 Config SharePoint 2013 Config
    SharePoint 2007 ToC Config SharePoint 2013 ToC Config


    Can anyone think of  way to present the three column layout again?  I've exported the SharePoint 2013 Web Part and tweaked the XML to include the following snippet but it didn't work.

    <property name="DisplayColumns" type="int">3</property>


    Steven Andrews
    SharePoint Business Analyst: LiveNation Entertainment
    Blog: baron72.wordpress.com
    Twitter: Follow @backpackerd00d
    My Wiki Articles: CodePlex Corner Series
    Please remember to mark your question as "answered" if this solves (or helps) your problem.

    Tuesday, November 11, 2014 1:52 PM
    Answerer

Answers

  • Hi Steven,

    I verified this issue in my SharePoint server 2013, and found out that the column setting disappears since 2013 version, it still exists in 2010 version.

    Please create a page name p2 in Pages library, and check it in, then publish it. And try the powershell script below:

    $web = get-spweb http://sp/sites/retu
    
    $webpub = [Microsoft.SharePoint.Publishing.PublishingWeb]::GetPublishingWeb($web)
    
    $pages = $webpub.GetPublishingPages()
    
    $pages | select url
    
    $webpub
    
    $page = $pages | ?{$_.url -like "*p2.aspx*"}
    
    $page.url
    
    $page.checkout()
    
    $manager = $web.GetLimitedWebPartManager($page.Url,[System.Web.UI.WebControls.WebParts.PersonalizationScope]::Shared)      
    
    #$manager.WebParts.Count
    
    $webpart = $manager.WebParts | ?{$_.title -eq "table of contents"}
    
    $webpart.DisplayColumns
    
    # set the number of columns you want to display 
    
    $webpart.displaycolumns = 7
    
    $page.update()
    
    $page.checkin("Checked in through PS") 

    Regards,


    Rebecca Tu
    TechNet Community Support


    • Edited by Rebecca Tu Wednesday, November 12, 2014 9:20 AM
    • Marked as answer by Rebecca Tu Tuesday, November 25, 2014 1:16 AM
    Wednesday, November 12, 2014 9:20 AM

All replies

  • Hi Steven,

    I verified this issue in my SharePoint server 2013, and found out that the column setting disappears since 2013 version, it still exists in 2010 version.

    Please create a page name p2 in Pages library, and check it in, then publish it. And try the powershell script below:

    $web = get-spweb http://sp/sites/retu
    
    $webpub = [Microsoft.SharePoint.Publishing.PublishingWeb]::GetPublishingWeb($web)
    
    $pages = $webpub.GetPublishingPages()
    
    $pages | select url
    
    $webpub
    
    $page = $pages | ?{$_.url -like "*p2.aspx*"}
    
    $page.url
    
    $page.checkout()
    
    $manager = $web.GetLimitedWebPartManager($page.Url,[System.Web.UI.WebControls.WebParts.PersonalizationScope]::Shared)      
    
    #$manager.WebParts.Count
    
    $webpart = $manager.WebParts | ?{$_.title -eq "table of contents"}
    
    $webpart.DisplayColumns
    
    # set the number of columns you want to display 
    
    $webpart.displaycolumns = 7
    
    $page.update()
    
    $page.checkin("Checked in through PS") 

    Regards,


    Rebecca Tu
    TechNet Community Support


    • Edited by Rebecca Tu Wednesday, November 12, 2014 9:20 AM
    • Marked as answer by Rebecca Tu Tuesday, November 25, 2014 1:16 AM
    Wednesday, November 12, 2014 9:20 AM
  • Hi Rebecca,

    Great script, I'm working with a colleague now to see if I can use it.  Two clarifications for you, when you have a moment; -

    1. Can you think of any reason why this wouldn't work on a Team Site using the Wiki Home Page feature?
    2. Can this script be adapted to work with HSarePoint Online?

    Many thanks,
    Steven


    Steven Andrews
    SharePoint Business Analyst: LiveNation Entertainment
    Blog: baron72.wordpress.com
    Twitter: Follow @backpackerd00d
    My Wiki Articles: CodePlex Corner Series
    Please remember to mark your question as "answered" if this solves (or helps) your problem.

    Wednesday, November 12, 2014 12:03 PM
    Answerer
  • Hi Steven,

    Any updates on this issue?

    For your question:

    1.As I can tell, [Microsoft.SharePoint.Publishing.PublishingWeb]::GetPublishingWeb is dedicated for pages, when dealing with Wiki page, we use ::WikiPage as suffix.

    2.Not sure about will it work with SharePoint online, it might take some time to test with Online environment.

    Regards,


    Rebecca Tu
    TechNet Community Support

    Friday, November 14, 2014 2:22 AM
  • Excuse me. You are the only help I've found. How could I hide Quick Launch of each level?
    Monday, June 20, 2016 10:56 AM
  • Hi, this script didn't worked. I am getting after running the script:

    The property ´displaycolumns´cannot be found on this object. Verify that the property exists and can be set.

    Tuesday, February 21, 2017 8:24 PM
  • Seems this script no longer has an effect in SP2016. Anyone else encountered the issue in SP2016?
    Monday, December 11, 2017 4:28 AM