1

Is it possible to determine a sites default library for SharePoint 2007,2010 and 2013. I can see that in SharePoint 2016 and SharePoint online that the basetype is 700. When you create a library through the app option this is 101.

In the lower versions it appears they are all 101. How do I determine the original (system generated out of the box) is the default. In SharePoint 2007 a user can have two lists by default. 'Personal Documents' and 'Shared Documents'. Ideally I would like to say 'Personal Documents' is the default. The problem is that I can't use the name as this could be changed. Is there anyway to identify this? Is there a property or and Id that I could use?

Thanks in advance

4
  • what exactly is the problem you are trying to solve? I'm not sure what you mean by "sites default library" Feb 20, 2017 at 15:17
  • When you create a site in the left hand menu there is a link to 'Documents' I guess this is the default for the site. If you say go into OneDrive you have a default documents library. In SharePoint 2007 you have a default list 'Personal Documents' I'm just trying to identify these
    – Webfort
    Feb 20, 2017 at 15:45
  • every site is based on a template. the site template defines which lists are deployed on site creation. some deploy calendars, document libraries such as "documents" or "shared documents". this really depends on the type of site, being team site, publishing, blog, etc. some sites enable publishing which brings additional lists. if you want to know all you can look at onet.xml files or create a site of each type and check manually Feb 20, 2017 at 15:48
  • So I guess what I am trying to achieve is not possible then?
    – Webfort
    Feb 20, 2017 at 18:26

1 Answer 1

0

I think I'm starting to get the picture so I'll post this as an answer.

From what I understand, you want to be able to identify which lists in a site are out-of-the-box, meaning, which lists are shipped with the site/web template and not those created on demand later ("default" may not be the best word here).

Looking at the BaseTemplate/BaseType may not be a good idea because typically the template IDs are generally available (e.g. 101 for document library, 100 for custom list).

Although not ideal, a possible method to identify out-of-the-box lists if something like this,

public string[] GetOOTBListsToDelete()
        {
            return (new string[] { 
                "Documents",
                "Shared Documents",
                //"Tasks",
                //"Workflow History",
                //"Workflow Tasks",
                //"WF Tasks",
                //"Site Assets",
                "Announcements",
                "Team Discussion",
                "Calendar",
                "Links"
            });
        }

If you start digging a little deeper, you'll notice that a lot more lists reside on your site(s) that you may not even be aware of,

public string[] GetListsToIgnore()
        {
            return (new string[] { 
                "Style Library",
                "Master Page Gallery",
                "Drop Off Library",
                "Pages",
                "Site Pages",
                "Site Assets",
                "Composed Looks",
                "Documents",
                "Shared Documents",
                "Publishing Images",
                "Site Collection Documents",
                "Site Collection Images",
                "Workflow Tasks",
                "WF Tasks",
                "Workflow History",
                "Team Discussion",
                "Tasks",
                "Links",
                "Calendar",
                "Announcements",
                "Access Requests",
                "Tiles",
                "Converted Forms",
                "List Template Gallery",
                "Solution Gallery",
                "Theme Gallery",
                "Form Templates",
                "Web Part Gallery",
                "wfpub",
                "Images",
                "Maintenance Log Library",
                "recovery",
                "Reporting Templates",
                "Translation Packages",
                "Customized Reports"
                //"TaxonomyHiddenList",
                //"User Information List",
                //"Translation Status",
                //"Variation Labels",
                //"Relationships List",
                //"Maintenance Log Library",
                //"Device Channels",
                //"Quick Deploy Items",
                //"Notification List"
            });

Further reading,

List Template Types

Using BaseTemplate and BaseType

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.