Hiding subsites in Table of Contents Web Part - SharePoint 2010

I've gone through the normal steps of having the table of contents web part not show a subsite (uncheck the box that says "Show Hidden Sites" as well as hide the site in the global navigation) but for whatever reason, the site I've hidden still
appears in the table of contents. Is there any way to remove it without deleting the subsite entirely?
Thoughts?

Actually, a version of Nate's solution did work for me, it just needs more details.....
Where you need to check off "Show Subsites" is in the "Current Navigation" section of SiteSettings/Navigation, and then hide the sites from THERE in Navigation Editing and Sorting  (I had already tried it on the Global Navigation side
and the subsites still appeared in the Table of Contents).  
For our particular needs, we did NOT want those sites on this root site navigation sidebar as well, so after setting the specific subsites to "Hidden" and saving changes, I went back to SiteSettings/TreeView and unchecked "Enable Quick Launch".
 All appears on the Root Site TOC as desired.
So, Nate was right about the whole counter-intuitive thing, but no need for custom css or de-activating/activating the publishing  features
--VS

Similar Messages

  • "Table of Contents" web part - How to have expand/collapse buttons? (I can use only CSS/JavaScript/JQuery)

    Hi there,
    I have a Table of Contents web part which is great. Is there a way so it shows only top level sites and then one can expand or collapse any top level site to see/hide the subsites?
    As of now it shows
    HR Parent site
    - HR sub site 1
    - HR sub site 2
    IT Parent site
    - IT sub site 1
    - IT sub site 2
    What I want is 
    + HR Parent site
    + IT Parent site
    So one can expand or collapse on demand.
    Any relevant JS/CSS/JQuery code?
    Thank you so much.

    Hi,
    According to your post, my understanding is that you want to expand or collapse the level site for the table of contents web part.
    I have made a simple code demo below to achieve this scenario, you can refer to it.
    <script src="http://code.jquery.com/jquery-1.10.2.min.js" type="text/javascript"></script>
    <script type="text/javascript">
    $(function(){
    var iconCollapse = "/_layouts/images/collapse.gif";
    var iconExpand = "/_layouts/images/expand.gif";
    $("div[id='WebPartWPQ2'] li ul").hide();
    //ugly way
    var $t = $("#WebPartWPQ2 div").children("ul").children("li").children("div");
    $t.each(function(){
    //console.log($(this).html());
    $(this).attr("style", "float: right; margin-right: 297px; line-height: 8px;");
    $(this).css("display","inline");
    $("<a src=" + iconExpand + "></img>").insertBefore($(this));
    $("a[class='min']").click(function()
    var img = $(this).children();
    //Traverse the DOM to find the child UL node
    var subList = $(this).siblings().children('ul');
    //Check the visibility of the item and set the image
    var Visibility = subList.is(":visible")?img.attr('src',iconExpand):img.attr('src',iconCollapse);
    //Toggle the UL
    subList.slideToggle();
    </script>
    Note: Yous should change the Web part ID and the css style to fit your environment.
    Thanks & Regards,
    Jason
    Jason Guo
    TechNet Community Support

  • Table of Contents Web Part

    We have a website that builds a sitemap using the OOTB Table of Contents web part to build a Site Map. The site consists of several subsites and the site map is close but under one particular subsite though the site map shows duplicate links. As
    an example if you look in the page library you see page1.aspx, page2.aspx, page3.aspx and page4.aspx but on the sitemap page it displays:
    SubsiteName
    page1
    page2
    page3
    page4
    page2
    page1
    page3
    Page4
    The repitition isn't in any order either which i have tried to display in my example. Anyone else witnessed this? We have 5 different environments and all are affected in the same way.
    Thanks in advance

    hi
    good that you found workaround, but I would anyway add few words here which may help to troubleshoot original problem: in this case it is worth to check navigation settings of the problematic site. There may be some headings and links added manually, which
    cause this behavior.
    Blog - http://sadomovalex.blogspot.com
    Dynamic CAML queries via C# - http://camlex.codeplex.com

  • Table of contents web part doesn't display all data

    Hi,
    We did a test migration from Sharepoint 2007 to SharePoint 2013. There is a Table of contents web part that is being used to display all of the team sites (more than 25). In the SharePoint 2013 version, the TOC web part is not displaying all of the sites.
    Any ideas of how to make it show all?
    thanks,
    Sherazad

    Hi Sherazad,
    According to your description, my understanding is that you want to display all sites in the Table Of Content web part.
    There is a limitation of the web part, the maximum number of the items displaying in the web part is 50. If you want to display more 50 items, you need to increase or remove the limitation. You need to go to the web.config file of the SharePpoint site, the
    path is C:\inetpub\wwwroot\wss\VirtualDirectories\port number, then find all navigation providers, and add
    DynamicChildLimit attribute to each one . More information, please refer to the link below:
    http://praveenbattula.blogspot.in/2010/11/table-of-contents-web-part-remove-max.html
    Note: before changing web.config, please make a backup for the file.
    After the above, if your issue still exists, please open your site->Site Settings->Navigation, change the value from 20 to [whatever number you want to display] in the “Current Navigation”section. More information,
    please refer to the link:
    http://www.chaitumadala.com/2010/05/sharepoint-2010-table-of-contents.html
    I hope this helps.
    Thanks,
    Wendy
    Wendy Li
    TechNet Community Support

  • SharePoint 2013 Table of Contents Web Part

    I have upgraded to SharePoint 2013 and have a table of contents web part that is supposed to display 5 columns. Instead, it is displaying all the sites in one long vertical column. I found the PowerShell script to set the displaycolumns property on the
    web part. However, when I ran the script, this property was already set to 5, yet it is still only displaying one column. I tried adding another table of contents web part and setting the displaycolumns to 5, but that did not work either. How can I make
    this web part to display properly?

    Hi gmchusyr,
    What script did you use for this issue?
    Table of Contents web part's display column is removed from SharePoint 2013 version, it still display in SharePoint 2010.
    Please try to run the PowerShell commands in the TechNet blog below, compare the result.
    Table of Content Web Part: Slightly different in SharePoint 2013 / Online:
    http://social.technet.microsoft.com/wiki/contents/articles/28429.table-of-content-web-part-slightly-different-in-sharepoint-2013-online.aspx
    Best Regards,
    Wendy
    Forum Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected]
    Wendy Li
    TechNet Community Support

  • How to dynamically change link in Page Viewer Web Part SharePoint 2010?

    Newbie Question:
    Situation:
    a) Created: Two Site Pages page 1 & page 2
    b) Page 1: Includes simple hyperlink text Example - Home | About Us | Contact etc
    c) Page 2: Includes Page Viewer Web Part that includes link to an existing web site (this site has all of the pages) and the olde site is shown in SharePoint site
    Complication:
    a) I want the users to click on Page 1 - About Us etc
    b) The View on Page 2 - page viewer link should be dynamically updated to About Us . If user clicks on contact us on Page 1..the page 2 view should change dynamically to Contact US
    ASK:
    a) How do I dynamically update the links in Page Viewer web part using minimal coding (if possible)
    Any Guidance will be greatly appreciated.

    Hello,
    You can also used the another appoch,
    Create your custom webpart , then add the PageViewer Webpart at run time,Create webpart property for the custom webpart to change the url and add the PageViewer webpart runtime,
    I have created the custom webpart property to specified the url at the tine of edit the webpart
    Here is the code
    using System;
    using System.ComponentModel;
    using System.Web;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using System.Web.UI.WebControls.WebParts;
    using Microsoft.SharePoint;
    using Microsoft.SharePoint.WebControls;
    using System.Collections;
    using Microsoft.SharePoint.Publishing.WebControls;
    using Microsoft.SharePoint.WebPartPages;
    namespace MyNameSpace.MyPageViewer
    [ToolboxItemAttribute(false)]
    public class MyPageViewer : System.Web.UI.WebControls.WebParts.WebPart
    private string _customUrl = "http://yourdefaulturl";//Specified default url
    [WebBrowsable(true)
    , Personalizable(true)
    , Bindable(true)
    , Browsable(false)
    , DefaultValue("")
    , Category("Custom Page Viewer Properties")
    , WebPartStorage(Storage.Shared)
    , FriendlyName("PageViewer URL")
    , Description("PageViewer URL")]
    public string CustomUrl
    get { return _customUrl; }
    set {if (string.IsNullOrEmpty(value) == false) { _customUrl = value; } }
    #endregion
    public MyPageViewer()
    this.ChromeType = PartChromeType.None;
    protected override void OnInit(EventArgs e)
    EnsureChildControls();
    base.OnInit(e);
    protected override void CreateChildControls()
    string pageViewerUrl = CustomUrl;
    Microsoft.SharePoint.WebPartPages.PageViewerWebPart pageViewerWebPart = new Microsoft.SharePoint.WebPartPages.PageViewerWebPart();
    if (!string.IsNullOrEmpty(pageViewerUrl))
    pageViewerWebPart.ContentLink = pageViewerUrl;
    pageViewerWebPart.ChromeType = PartChromeType.None;
    pageViewerWebPart.Height = "382";
    pageViewerWebPart.Width = "682";
    this.Controls.Add(pageViewerWebPart);
    protected override void OnLoad(EventArgs e)
    base.OnLoad(e);
    protected override void OnPreRender(EventArgs e)
    base.OnPreRender(e);
    Hope this will help you
    Hiren Patel | Please click "Propose As Answer" if this post solves your problem or "Vote As Helpful" if this post has been useful to you.

  • Remove the scroll bar of excel sheet in excel web access web part sharepoint 2010

    Hi All,
    i am using excel web access in sharepoint 2010. but when i insert excel file in this its showing me 2 scroll bar. one for sharepoint page which is easy to remove and second in excel file.
    so i want to remove the excel sheets scroll bar not for pages scroll bar.
    i have tried all things like adjust height width and all things but unable to remove scroll bar for
    excel file.
    Please give some soln or steps for this. Please reply ASAP.
    Thanks
    Vivek

    Hi Vivek,
    You tried almost all possible ootb way to achive your goal, but contact inside excel file and browser compatibility restrict you to adjust height and width using web part properties.
    You can try below article and include that script to fix this 
    https://www.nothingbutsharepoint.com/sites/eusp/Pages/jquery-for-everyone-dynamically-sizing-excel-web-parts.aspx
    Let us know if this helps, thanks
    Regards,
    Pratik Vyas | SharePoint Consultant |
    http://sharepointpratik.blogspot.com
    Posting is provided AS IS with no warranties, and confers no rights
    Please remember to click Mark As Answer if a post solves your problem or
    Vote As Helpful if it was useful.

  • Read all projects within Project Online using web part Sharepoint

    Hello all. Can we get data of all projects from Project Online in Sharepoint Site? So far as I understand we can get data of list like this:
    SPWeb web = SPContext.Current.Web;
    SPList issueList = web.GetList("https://tenant.sharepoint.com/sites/demo/Sample Project 1/Lists/Issues/AllItems.aspx");
    Do you have any some good tutorial? I am new on web part Sharepoint.
    Thanks in advance.

    Hello,
    Yes you can, I would use the ProjectData API if you are not bothered about security (accessing all projects etc.) or if you want the data returned to be accessed controlled use the ProjectServer API. Examples below:
    ODATA API (ProjectData):
    <PWA site URL>/_api/ProjectData/Projects
    JSOM REST API (ProjectServer):
    <PWA site url>/_api/ProjectServer/Projects
    Regarding guides, just search for SharePoint apps / App part / client web part. Some simple examples of using  the APIs mentioned in JavaScript on the Project sites can be seen below:
    https://gallery.technet.microsoft.com/scriptcenter/Server-Information-ab10fd63
    https://gallery.technet.microsoft.com/scriptcenter/Server-Milestones-f8be71b8
    https://gallery.technet.microsoft.com/scriptcenter/Online-Server-on-a-page-1b1f14f5
    Paul
    Paul Mather | Twitter |
    http://pwmather.wordpress.com | CPS

  • Example to see all site collections in a specific content DB in sharepoint 2010

    Can someone give an example to see all site collections in a specific content DB
    in SharePoint 2010.
    I've tried the below ones but it gives all content DB's with all site collections.
    Get-SPContentDatabase | %{Write-Output "- $($_.Name)”; foreach($site in $_.sites){write-Output $site.url}}
    Appreciate your help

    Use Get-SPSite cmdlet
    $spAssgn = Start-SPAssignment;
    Get-SPSite -ContentDatabase "<SPContentDBName>" -Limit ALL -AssignmentCollection $spAssgn|Select Title,Url;
    Stop-SPAssignment $spAssgn;
    Get-SPSite
    This post is my own opinion and does not necessarily reflect the opinion or view of Slalom.

  • Content Query Web Part - in 2010 but Catalog-Item Reuse in 2013

    In SharePoint 2010 I exported this SharePoint Links List to be a WebPart that I can put for things.  It's our company's "Popular Links."  "WE" decide what is "Popular."  We have a few that I am sharing here. 
    In 2010 I got this to be a web part that I can pop onto multiple sites on our site collection.  Now in 2013, I'd like to use Search if possible to get this to work.  I tried and it didn't come out right.
    SharePoint 2013 Enterprise Edition RTM dec 2013 CU
    I tried the Items Matching a Tag and I set a tag to be "Popular Links" and set the tag on the items below in this graphic.  I then set it to look only at these.
    This is on the same page on the "home" page, publishing turned on.  I don't have the "feel" of the first "list" that I did on the graphic above.  It's not CSS as it is on the same page using the same master page. 
    Also when I click on the link it takes me to the displayform.aspx?id=1 page and I want to have the user just click the hyperlink.
    Could I / should I use the Catalog-Item Reuse feature with publishing and get a new site collection setup with this?  I am frustrated as I'd like to "share" information in another site, just as this "perfect" example (for me) to
    show this information multiple times.
    Thank you!

    CQWB is supported for Publishing Sites or site having publishing feature turned on, on other it will not work as expected.
    You can add it on the page from ribbon insert web part> from categories select Content Rollup > next pane slect Content Query.
    http://info.axceler.com/Blog/bid/116286/Content-Query-Web-Part-vs-Content-Search-Web-Part
    http://www.cwheeler76.com/Lists/Posts/Post.aspx?List=9a19060b-0efe-4368-8360-b07d23dc5c7b&ID=6&Web=916c3f13-7f62-4b71-b302-6fd9106b4bb2
    here is MSDN to customize it:
    http://msdn.microsoft.com/en-us/library/ff650512.aspx 
    Please remember to mark your question as answered &Vote helpful,if this solves/helps your problem. ****************************************************************************************** Thanks -WS MCITP(SharePoint 2010, 2013) Blog: http://wscheema.com/blog

  • Accessing page metadata on a content web part to generate a custom link.

    This is what I am trying to do in Sharepoint 2013...
    Page1 has a metadata element which tags the page to a department (e.g. Finance, HR, Operations etc) and another element that tags the page to a location (NY, London, Brussels etc). On a new web part on the page I want to create a link to another page, Page2.
    Through the link, I want to pass the value of these metadata elements to Page2. On Page2, through an onload JS function, I want to change the value of some field (text or dropdown etc) using the passed values.
    I am having trouble figuring out a way to perform the page1 actions. I need to understand how to generate a URL based on the metadata elements, which will contain parameter values equal to these element values. I'd appreciate any help in understanding the
    way to do this.
    Regards,
    VRA

    Hi Vinay,
    According to your description, my understanding is that you want to generate a URL which contains the tags of the page1.
    I recommend to programmatically get the tags of the page1 in SharePoint first, please refer to the link below:
    http://www.c-sharpcorner.com/uploadfile/anavijai/programmatically-get-all-the-social-tags-for-the-specified-url-in-sharepoint-2010/
    After that, we can set the URL like this: http://server/pages/page2?department=Finance&location=NY. (Finance and NY are an example of the tags gotten programmatically)
    Then we can pass the parameter values of the tags to page2 using JavaScript.
    http://javascriptproductivity.blogspot.com/2013/02/get-url-variables-with-javascript.html
    Best regards.
    Thanks
    Victoria Xia
    TechNet Community Support

  • Creating chart from web part sharepoint 2013 online

    hello, my name is peter and i know to solve the problem with creating charts from web part . i am familiar with excell services, but it doesnt solve my problem because it is not taking data from web parts so it is static. Thank you for your time

    If you want info about creating charts in web parts, this one is quite nice:
    http://social.technet.microsoft.com/wiki/contents/articles/17614.adding-charts-to-standard-webparts-and-visual-webparts.aspx
    If you're worrying about getting data from another web part, you need to use web part connections and start here:
    http://msdn.microsoft.com/en-us/library/ms469765(v=office.14).aspx
    Kind regards,
    Margriet Bruggeman
    Lois & Clark IT Services
    web site: http://www.loisandclark.eu
    blog: http://www.sharepointdragons.com

  • Javascript with window.location.href no longer working in Content Editor in Sharepoint 2010 where users have IE8

    I have recently found that when using a Sharepoint 2010 Content Editor web part to house some Javascript that the window.location.href (or window.location) is not working when the end users have IE8 installed on their PC's.  We have confirmed
    that the window.location.href is working if the users are on IE7 or Google Chrome with the same Javascript.  In addition, we added alert() to the javascript to ensure that it was infact running, which the alerts appeared on the screen with no issues. 
    The result that I am receiving in IE8 is that when the window.location.href is set to the url that the user should be directed to, it simply refreshes the current page and leaves the user where they originally were.
    I have seen the posts to have my site setup as a Trusted Site, but this is not an option for our company as they defined all internal Sharepoint sites as trusted already.  Besides this, having all users go into their Internet Options is not really a
    solution but a means to annoy your users.
    What I am looking for is a permanent solution that I can make within my javascript that will work for both IE7 and IE8 users within a Sharepoint 2010 environment.  If anyone has any suggestions, please let me know.  Thanks in advance.
    Below is a snipet from my javascript code for review:
    <script type="text/javascript">
    function RedirectUrl() {
    alert('button pressed');
    var tb = document.getElementById("tbSearch").value;
    var cs = document.getElementById("sfield").value;
    var url = "";
    if (tb != "") {
    url = "FilterName=" + cs + "&FilterMultiValue=*" + tb + "*";
    if (cs == "Request%5Fx0020%5FID1"){
    alert("Request%20ID%20Search.aspx?" + url)
    window.location.href = "Request%20ID%20Search.aspx?" + url;
    else {
    window.location.href = "All%20Requests.aspx?" + url;
    else {
    return false;
    function ClearUrl() {
    window.location.href = "All%20Requests.aspx";
    </script>
    <br/>
    <span style="font-family: calibri; color: #000066; font-size: 14pt; font-weight: bold">Search</span>
    <br/>
    <span style="font-family: calibri; color: black">Search Field: </span>
    <select id="sfield" style="font-family: calibri; font-size: 10pt">
    <option value="Request%5Fx0020%5FID1">Request ID</option>
    </select> &#160;
    <span style="font-family: calibri; color: black">Search Text: </span>
    <input id="tbSearch" onkeypress="if (event.keyCode == 13) document.getElementById(&#39;btnSearch&#39;).click()" style="font-family: calibri"/>
    <button id="btnSearch" onclick="return RedirectUrl();" type="submit" style="font-family: calibri">Search</button>
    <button id="btnClear" onclick="return ClearUrl();" type="submit" style="font-family: calibri">Clear Search</button>
    <br/>
    <br/>
    <span style="font-family: calibri; color: #000066; font-size: 14pt; font-weight: bold">Search Results - All Requests</span>
    <br/>

    Hi,
    According to your post, my understanding is that the window.location.href not worked in IE 8.
    I think the issue
    is likely due to the value of your variables. If they contain special or invalid characters, those needs to be passed through
    encodeURIComponent before being assigned to window.location.href.
    http://stackoverflow.com/questions/18278777/window-location-href-not-working-on-ie
    http://stackoverflow.com/questions/6297291/window-location-problem-in-ie
    You can also use the following methods to check whether it works.
    Window.navigate();
    Winodw.history.back();
    Self.location.href;
    Top.location;
    Thanks & Regards,
    Jason
    Jason Guo
    TechNet Community Support

  • Error while connecting to external SQL table using BCS identity in SharePoint 2010

    Hi all,
    I am working on SharePoint Foundation 2010. I have a stand alone setup. Now I am trying to connect to a SQL table in another server. I have used SharePoint Designer to connect using BCS. I have selected "BCS Identity" for authenticating with SQL
    in the external content type. then I created a list with this external content type.
    I get the following error upon opening the external list.
    Login failed for user 'INYKGW\sp_farm'.
    I am confused. how do I solve this error.
    any help is greatly appreciated.
    Thanks.

    Hi letShare ,
    Whether the  account 'INYKGW\sp_farm' is current user account or a service managed account?
    Could you  please  provide detail error message of ULS log  to determine the exact cause of the error.
    For SharePoint 2010, by default, ULS log is at      
    C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\LOGS
    Also please have a look at  the blog :
    http://www.wonderlaura.com/Lists/Posts/Post.aspx?ID=82
    Best Regards,
    Eric
    Eric Tao
    TechNet Community Support

  • Custom host-name for web application SharePoint 2010

    I am facing a weird behavior. Can anyone help me regarding this?
    Steps performed:
    1. Created a web application using custom host name.
    2. Created a site collection using "Blank" site template. Nothing issues.
    3. Created another site collection using "Publishing" site template. Authentication prompt came multiple times. IIS logs/Fiddler/HTTP Watch are full with 401 entries.
    4. Added the custom host-name with web server IP in local desktop hosts file(which is in intranet domain). Prompt issue fixed.
    5. Authentication mode set as NTLM. 

    Hi DDasgupta,
    After you created a web application with a custom host name, if you got a prompt for the user and you may face the following issues:
    There is continuous prompt for the credentials
    HTTP 401.1 error
    This shows that there is a problem with the Loopback configuration. This situation should occur only when we access the application from the server machine.
    For fixing the problem, we have to disable the Loopback value inside the registry.Open the Registry Editor (regedit.exe) and locate the following key:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa, and create a new Key Value of type DWORD inside
    it and set the value to 1.
    More information, please refer to the link:
    http://www.c-sharpcorner.com/UploadFile/40e97e/sharepoint-2010-creating-host-name-for-web-application/
    I hope this helps.
    Thanks,
    Wendy
    Wendy Li
    TechNet Community Support

Maybe you are looking for