0

I'm currently trying to find a way to add the Web Parts attached to my lists into a template that I can then upload to multiple sites, has anyone had success doing this before?

I've tried to do it by saving the list as a template and checking the include content box but only the data attached to the list transfers over.

Help please.

4
  • can you please explain what do you mean by web parts attached to your list?
    – Sagar
    Jan 23, 2018 at 11:48
  • @Sagar yeah, by web parts I mean content editors and script editors Jan 23, 2018 at 12:01
  • If i understand correctly you have content editor and script editor webparts containing code that interacts with your list, and you desire to restore these webparts to new site along with your list
    – Sagar
    Jan 23, 2018 at 12:19
  • @Sagar Yes that's fairly accurate, I think the better way to put it is that I'd like it once I save it as a template that both editors be attached to the list with code in tac Jan 23, 2018 at 12:23

2 Answers 2

0

As per my knowledge you cannot have webparts included in list template. But you can try exporting and importing webparts by following below steps.

From the Web Part menu, choose Exportto create a .webpart file

In Design mode, select Add a web part. At the bottom of the Add Web Parts dialog box, click Advanced Web Part gallery and options.

On the Add Web Parts pane, select Importand then navigate to the .webpart file you created in the preceding procedure.

Click Upload and your Web Part appears in the list of Uploaded Web Parts.

Drag it into a Web Part zone on the page and you should see the same Web Part

1
  • When I try to do it this way I'm given this error: The file you imported is not valid. Verify that the file is a Web Part description file (*.webpart or *.dwp) and that it contains well-formed XML. Jan 23, 2018 at 14:18
0

As a workaround, you can edit the list’s AllItems.aspx page in SharePoint Designer, then put the html code to the list and save the .aspx file.

Then open this list SharePoint UI and edit the page, edit the list web part and made it "hidden" under Layout section.

Finally, save the list as template and check if the CEWP content included in the template.

More information check the similar post.

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.