0

I want to show some of the sub sites in a web part of main site. I have 10 sub sites of which 4 of them are work-space sites. I want to show all the work-space sites on the main site in a web part. I tried to use table of contents but it shows all the sub sites belonging to the site. I want only my required sites to be shown in web part as links . Can some one suggest on how to approach this in SharePoint 2010. thanks in advance.

2
  • What identifies the required sites? If there is nothing special or "automatic" here you could just use Summary links webpart and add the links manually Commented Aug 11, 2015 at 18:22
  • @robert lindgren whenever we create a workspace site the link should be populated at the web part which cannot be done through summary links.
    – SPLearner
    Commented Aug 11, 2015 at 18:24

1 Answer 1

1

you can try the following code snippet and use it in a custom webpart/visual web part to filter and display the links of the specific template based sub sites.

    using Microsoft.SharePoint;
    using Microsoft.SharePoint.Meetings;


            public void DisplayLinks()
            {
                using (SPSite site = new SPSite("http://sitecollectionrul"))
                {
                    using (SPWeb web = site.OpenWeb("subsitename"))
                    {
                        //// IsMeetingWorkspaceWeb Method is used to determine whether the specified Web site was created by using a Meeting Workspace template
                        if (SPMeeting.IsMeetingWorkspaceWeb(web))
                        {
add your logic to display the links here
                        }
                        else
                        {
                        }
                    }
                }
            }
        }
    }
1
  • I cannot use server side coding in our environment. Thnaks for the snippet though .
    – SPLearner
    Commented Aug 12, 2015 at 14:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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