Omicron Llama

Coding all day, every day.

Creating a list from a custom template

So it seems impossible to be able to create a new list from a custom list template (created in the UI and saved as a .STP file) using the client object model (JavaScript or Managed) – so in this particular project we got around it by generating a URL for the user to click onto which presented them with the OOTB standard interface for creating lists – but passing in the name of the STP file in the querystring, telling SharePoint which list template to use – simples!

https://webapplication/site/_layouts/15/new.aspx?CustomTemplate=MyListTemplate%2Estp

Note the %2Estp part in the url, this is simple the file extension “.stp”. You can see filenames of the custom templates in your site under Site Actions -> Site Settings -> Galleries -> List Templates (from your site collection root).

It’s still not a fully perfect way of creating a list from a (.stp) template, for that you will still need to have your template in a custom feature, if you want full automation.

,

Leave a Reply

Your email address will not be published. Required fields are marked *