Can I save created forms into site template?

rss

Posted by eedoh - Jan 31 ’14 at 12:25

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?

  • Dmitry Kozlov
    Dmitry Kozlov
    Admin
    Member for: 9 years 8 months 16 days
    #1 by Dmitry Kozlov Jan 31 ’14 at 04:42

    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:

    <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:

    <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.

  • Jeff Childers
    Jeff Childers
    Member
    Member for: 9 years 9 months 9 days
    #2 by Jeff Childers Feb 1 ’14 at 02:58

    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?

  • Dmitry Kozlov
    Dmitry Kozlov
    Admin
    Member for: 9 years 8 months 16 days
    #3 by Dmitry Kozlov Feb 2 ’14 at 03:47

    [#2]: 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
    Member
    Member for: 9 years 4 months 8 days
    #4 by eedoh Feb 4 ’14 at 06:27

    [#1]: 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.

  • Jeff Childers
    Jeff Childers
    Member
    Member for: 9 years 9 months 9 days
    #5 by Jeff Childers Feb 5 ’14 at 12:57

    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.

  • Dmitry Kozlov
    Dmitry Kozlov
    Admin
    Member for: 9 years 8 months 16 days
    #6 by Dmitry Kozlov Feb 5 ’14 at 03:02

    [#5]: 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:

    <script type="text/javascript" src="/sites/rootsite/style library/FormsDesigner/JQuery/jquery-1.10.2.min.js" />
    
  • Jeff Childers
    Jeff Childers
    Member
    Member for: 9 years 9 months 9 days
    #7 by Jeff Childers Feb 6 ’14 at 12:06

    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?

     

     

  • Dmitry Kozlov
    Dmitry Kozlov
    Admin
    Member for: 9 years 8 months 16 days
    #8 by Dmitry Kozlov Feb 6 ’14 at 02:58

    [#7]: 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 [email protected].

  • Jeff Childers
    Jeff Childers
    Member
    Member for: 9 years 9 months 9 days
    #9 by Jeff Childers Feb 12 ’14 at 09:52

    [#8]: 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.

     

  • Dmitry Kozlov
    Dmitry Kozlov
    Admin
    Member for: 9 years 8 months 16 days
    #10 by Dmitry Kozlov Feb 13 ’14 at 02:09

    [#9]: Hi Jeff,

    Yes, there is no need to modify files themseves but only if you make template from a list. If you make site template you must modify form files as described above.

Displaying 1 to 10 of 29 messages
Previous123