0

I would like to know the list Template ID for an asset Library.

Here is a link that list the template type enumeration available for all kind of lists and libraries... but nothing about the asset Library.

My aim is to customize classic (not custom) lists and document libraries appearance that are already existing on the site, so it's out of order to create any additionnal content. The asset Library used is already created and must be the one that will be used. Thank you.

  • Is any of the answer helps you? – Hardik May 13 '16 at 12:48
  • All of them. The up votes are from me. – ameliapond May 13 '16 at 14:44
1

If you use REST to query the library, you'll notice that the template type ID is 851, which was introduced in SharePoint 2010. You'll see the details in the result of REST query.

http://<<server>>/_api/web/Lists/getByTitle('LibraryTitle')

Also here's a table showing you the details: http://techtrainingnotes.blogspot.ca/2010/01/sharepoint-2010-registrationid-list.html

1

Images, Site Collection Images

This system library was created by the Publishing feature to store images that are used on pages in this site.” (not in SPListTemplateType)

Also: Asset Library in 2010

just using a foreach loop to iterate through the SPWeb.Lists collection and then check each list's BaseTemplate value to get all the picture and asset libraries.

Code provided below:

private void PopulateImageLibraryDropDownList()
    {
        base.EnsureChildControls();

        _dropDownList.Items.Clear();
        _dropDownList.Items.Add(new ListItem("None", string.Empty));

        foreach (SPList list in SPContext.Current.Web.Lists)
        {
            if (!list.Hidden &
                list.BaseType == SPBaseType.DocumentLibrary &
                (
                    (int)list.BaseTemplate == 109 |     // Picture Library
                    (int)list.BaseTemplate == 851       // Asset Library
                ))
            {
                _dropDownList.Items.Add(new ListItem(list.Title, list.ID.ToString()));
            }
        }
    }
  • REST would give you a much faster and easier way to get library's details. – Mohamed Derhalli May 13 '16 at 7:44
1

Here you go:

(int)list.BaseTemplate == 109 | // Picture Library

(int)list.BaseTemplate == 851 // Asset Library

Note: The BaseTemplate property is of type SPListTemplateType which is an enum containing the template ID's of a number of the OOTB list definitions. The Asset Library however, is not included in the enum.

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.