How to create a custom template for userdefinedform


#1

SS4.4

Hi,

I don’t want userforms to take the Page-Template for rendering. I rembere I could create an UserDefinedForm.ss with my custom markupand save it to my templates folder. This not working in SS4. I guess because of the namespace-concept. So I copied the following structure to my template folder,… Silverstripe/UserForms/Model and saved my custom Template. Well,… it does not work.

Any advice?

Kind regards
Fabian

// Include any relevant code. If you have a lot of code, link to a gist instead.

#2

The file you want to update is the UserDefinedForm.ss if you want to change the general page template and output the form with the $Form Variable.

You would have this in a folder like -

/app/templates/SilverStripe/UserForms/Model/Layout/UserDefinedForm.ss

If you need to change the actual forms markup, you would edit/add a

/app/templates/SilverStripe/UserForms/Form/UserForm.ss

If you check their repository on Github, you can simply copy their folder structure for their templates and copy their file to as a base to edit.


#3

Hej obj,

thanks. So I did but it just takes the Page.ss
I put it to the app-folder and to the themes/mytheme/template-folder aswell… but no result…


#4

I now copied the folder direcly from the repository to my themes-folder an it s working…

Might have been some misspelling…

I say thank you :wink: