Developer forum

Forum » CMS - Standard features » Automatic template in Forms For Editors

Automatic template in Forms For Editors

Mads Poulsen
Mads Poulsen
Reply

Hi, 

In Forms For Editors i get the possibility to choose between "Automatic" and "Template" under the E-mail section on the module. 

I can't find where the template for "Automatic" is set. This is standard a Dynamicweb e-mail template.

How can i replace this with a custom template for the specific website? The template dosn't seem to be in the folder /Forms/Mail/


Replies

 
Morten Bengtson Dynamicweb Employee
Morten Bengtson
Reply

If you want to use a custom template then you should choose "Template" instead of "Automatic" and then select a template file located in the template folder /Forms/Mail.

See email settings and available template tags.

BR Morten

 
Mads Poulsen
Mads Poulsen
Reply

Hi Morten

Thanks for your answer - But what i'm looking for, is to edit the "Automatic" template, so that i dosn't need to select "Template" and choose between other files. 

 
Morten Bengtson Dynamicweb Employee
Morten Bengtson
Reply

The "Automatic" templates are located in /Admin/Module/BasicForms, but you shouldn't edit these as they will most likely be overwritten in future updates.

I guess you are asking for a new feature that enables you to select default templates? Right now it is only possible to select a default template for the form itself (see attached screenshot).

 

forms_for_editors_settings.png
 
Mads Poulsen
Mads Poulsen
Reply

Hi Morten

Ah, i see - Actiually it might not be possible to fix then. 

My dream was to be able to automaticly have chosen a custom template instead of DW template, so that you don't need to select a template to get one with your own template-design. Right know it looks in to the folder "Templates/Forms/Form", but what i wanted was for it to look into Templates/Designs/<Solution>/Forms/Form.

But i see the challenge in choosing from different designfolders, therefor it might not be possible.

Although the feature would still be cool, although i don't really see the solution :-) 

 
Morten Bengtson Dynamicweb Employee
Morten Bengtson
Reply
This post has been marked as an answer

If you place your module templates in your design folder, e.g. Templates/Designs/<DesignName>/Forms/Mail, then the module will look for templates in that folder... if the current site is configured to use that design (see attached screenshot). However, you still have to select the template on the module settings.

What you want is to have the module look for default templates in the current design folder? That is how the setting for default form template works, but it requires that you have templates with identical names in Templates/Designs/Forms/Form and Templates/Designs/<DesignName>/Forms/Form.

Go to Apps > Forms for editors. Select the form and go to settings. Select a default form template, e.g. /Templates/Forms/Form/MyCustomTemplate.cshtml

If you then create a page with the form and select "Automatic" then the module will look for the template /Templates/Designs/<DesignName>/Forms/Form/MyCustomTemplate.cshtml - and if the template was not found then it will look for /Templates/Forms/Form/MyCustomTemplate.cshtml

So, from what I understood, you just want the same functionality for the other templates, so that you can select default templates on the form settings, use "Automatic" on the paragraph module settings and have the module look for the default templates in the current design folder. Correct?

forms_for_editors_mail_template.png
Votes for this answer: 1
 
Mads Poulsen
Mads Poulsen
Reply

Hi Morten

Thanks for the answer. That seems to be doing the trick, so that it now works. 

 

You must be logged in to post in the forum