Can I save created forms into site template?

Discussions about Forms Designer for SharePoint 2013 / 2016 and Office 365.
eedoh
Posts: 37
Joined: Tue Feb 11, 2014

31 Jan 2014

Hello.

We're trying out Forms Designer and CrossSite Lookup for a project we just started. So far we like it, but we do have one BIG issue with them.

We're supposed to actually develop Sharepoint Site Template so the client can use that template each time they need to add new subsite. I just tried this, but after creating a subsite from the template, none of the list item forms are available. I just get the blank page (there's no even default Sharepoint form).

Letting the client import saved forms each time they add new subsite is not an option as the template is going to be huge.

Is there a way of saving the forms into the template and reusing them out of the box, or at least can we be sure that you're going to provide this feature in the next, say, 2 months, so we can go ahead and purchase the licenses, and upgrade the version later on?

User avatar
Dmitry Kozlov
Site Admin
Posts: 1524
Joined: Thu Jun 07, 2012

31 Jan 2014

Hello,

Currently, I can suggest the following workaround.

Before making a template, open your site in SharePoint Designer. Navigate to list where you have customized forms: Choose 'Lists and Libraries' in the left sidebar, select required list in the main panel. At the left bottom corner of this page you can find the list of content types. Choose content type which contains custom forms. Here you can change URLs of forms. Replace server relative path with ~list token. Examples:

Lists:
~list/fd_Item_Display.aspx
~list/fd_Item_Edit.aspx
~list/fd_Item_New.aspx

Document libraries:
~list/Forms/fd_Document_Display.aspx
~list/Forms/fd_Document_Edit.aspx
~list/Forms/fd_Document_New.aspx

Repeat these steps for each content type of each list and library where you have designed forms.

Next, you have to make small modifications of forms themselves. Open a designed form in SharePoint Designer and find the following lines:

Code: Select all

<SharePoint:ScriptLink ID="jquery" runat="server" Name="~sitecollection/style library/FormsDesigner/JQuery/jquery-1.10.2.min.js" OnDemand="false" />
<SharePoint:ScriptLink ID="jqueryui" runat="server" Name="~sitecollection/style library/FormsDesigner/JQuery/jquery-ui-1.10.3.custom.min.js" OnDemand="false" />
<SharePoint:ScriptLink ID="jquerycookie" runat="server" Name="~sitecollection/style library/FormsDesigner/JQuery/jquery.cookie.js" OnDemand="false" />
<SharePoint:ScriptLink ID="formsdesigner" runat="server" Name="~sitecollection/style library/FormsDesigner/form.min.js?rev=2_8_6" OnDemand="false" />
Replace them with the code below:

Code: Select all

<script type="text/javascript" src="/style library/FormsDesigner/JQuery/jquery-1.10.2.min.js" />
<script type="text/javascript" src="/style library/FormsDesigner/JQuery/jquery-ui-1.10.3.custom.min.js" />
<script type="text/javascript" src="/style library/FormsDesigner/JQuery/jquery.cookie.js" />
<script type="text/javascript" src="/style library/FormsDesigner/form.min.js?rev=2_8_6" />
Repeat this step for each custom form. Then you can save the site as template.

User avatar
Jeff Childers
Posts: 18
Joined: Sun May 25, 2014

01 Feb 2014

I have tried the above solution and things don't quite work correctly.

1. First, my original New Form was "/sites/dev/Lists/Template_MedChrono/fd_MedChrono_NewForm.aspx"

2. Second, I changed the new form to "~List/Template_MedChrono/fd_MedChrono_NewForm.aspx"

3. Third, I went into fd_MedChrono_NewForm.aspx and changed the four lines to match exactly what was in your post.

4. When I save as a template and then create list in new site, it now finds the form and opens it; however, there appears to be a javascript problem since the form does not render with CSS (ie., fields are there, but no tabs, etc.)

5. Also, I notice that my cross-site lookup columns are not working properly. Does cross-site lookup columns affect the ability to use a template?

User avatar
Dmitry Kozlov
Site Admin
Posts: 1524
Joined: Thu Jun 07, 2012

02 Feb 2014

Hello Jeff,

The instructions above are for SharePoint on-premises, not SharePoint Online. Instead of just replacing ScriptLinks with script tags, you should copy Name values from ScriptLinks, replace ~sitecollection token with site collection URL and put new values to src attributes of script tags.

eedoh
Posts: 37
Joined: Tue Feb 11, 2014

04 Feb 2014

Sorry for the late reply...

This worked perfectly for me. I do have some more issues, but not this big. This was a show-stopper. Thank you Dmitry.

I will post some more questions here, but this one was by far most important to me.

User avatar
Jeff Childers
Posts: 18
Joined: Sun May 25, 2014

05 Feb 2014

my site collection is https://XXX.sharepoint.com/sites/rootsite

I plan to create subfolders of this site as https://xxx.sharepoint.com/sites/rootsite/subfolders

When you say "replace ~sitecollection token with site collection URL and put new values to src attributes of script tags", do you mean to change the forms that I plan to use as templates to have https://xxx.sharepoint.com/sites/rootsite/subfolder/[stuff previously there] - if so, this will not work becuase "subfolders" will be unknown until the subsite is created.

User avatar
Dmitry Kozlov
Site Admin
Posts: 1524
Joined: Thu Jun 07, 2012

05 Feb 2014

Hello Jeff,

You should replace SharePoint:ScriptLink controls with script tags in all your designed forms. Copy Name attribute of SharePoint:ScriptLink to script tag as I shown in my first comment but replace ~sitecollection token with URL of your site collection, '/sites/rootsite' in your case. So, your URLs will have the following view or so:

Code: Select all

<script type="text/javascript" src="/sites/rootsite/style library/FormsDesigner/JQuery/jquery-1.10.2.min.js" />

User avatar
Jeff Childers
Posts: 18
Joined: Sun May 25, 2014

06 Feb 2014

Not able to get this to work. Here is what I am doing exactly. I have create a subsite with path /sites/dev/subsite.

I created a list in the subsite called "providers". I convert the form locations to:

"~list/fd_providers_NewForm.aspx" (and do the same for edit and display)


I delete the script links and add the following scripts:

<script type="text/javascript" src="/sites/dev/style library/FormsDesigner/JQuery/jquery-1.10.2.min.js" />
<script type="text/javascript" src="/sites/dev/style library/FormsDesigner/JQuery/jquery-ui-1.10.3.custom.min.js" />
<script type="text/javascript" src="/sites/dev/style library/FormsDesigner/JQuery/jquery.cookie.js" />
<script type="text/javascript" src="/sites/dev/style library/FormsDesigner/form.min.js?rev=2_8_6" />


I then save the provider list as a template.

Now, if I create the provider list from its template at /sites/dev/newsubsite/provider - it cannot find the forms

If I save /sites/dev/subsite as a site template with the provider list in it, it cannot find the form.

What am I doing wrong?

User avatar
Dmitry Kozlov
Site Admin
Posts: 1524
Joined: Thu Jun 07, 2012

06 Feb 2014

Hello Jeff,

Are you sure that you saved the modified content types? Is it possible to provide temporary access to your SharePoint Online? If so, please, send it to support@spform.com.

User avatar
Jeff Childers
Posts: 18
Joined: Sun May 25, 2014

12 Feb 2014

I want to thank you for helping me with this. In the end, for Office 365 deployments, the solution to this problem is a bit different from what is identified above. All that is required is to edit the content type to read:

~list/fd_Item_DisplayForm.aspx
~list/fd_Item_EditForm.aspx
~list/fd_Item_NewForm.aspx

Then save the list as a list template. There is no need to modify the three fd forms as they are already properly referenced for a subsite. I have also not found any problems or modifications necessary for cross-site lookup columns.


NOTE: if you later change the list, you must go back in and edit the default list form locations for that content type.

Locked
  • Information
  • Who is online

    Users browsing this forum: No registered users and 12 guests