10375 Posts in 2190 Topics by 1707 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 2392 Views |
-
User Defined Form - styling form fields

11 January 2010 at 9:05am
Hello,
I have a contact us page and using it with the User Defined Form module to create a contact form. Its setup as another template page called UserDefinedForm.ss and all is working fine.
But, I would like to customise the styling of the Form by adding css classes to it. To use the form on the template I add the silverstripe variable $Form.
Is it possible to create another template for $Form so that I can over ride the default layout and add additional classes?
If so what would I call the template file and where would it go (Inside the include?)I looked over the Module and the base Silverstripe code but could not figure out away to style the Form.
Any help is greatly appreciated.
Regards
Chris -
Re: User Defined Form - styling form fields

11 January 2010 at 1:22pm
You're going to have some issues trying to customize the html output of the UDF. If you want to edit the style of the form the best way is to use CSS to get the positioning / style effects. The form fields are fairly well equipped with class's which you can use as styling hooks so even with the existing html you should have enough options to get most form layouts working.
You can customize the form output but it means you're hard coding the form fields so makes using a template on a UDF kinda pointless - http://doc.silverstripe.org/doku.php?id=form&s=form#using_a_custom_template
| 2392 Views | ||
|
Page:
1
|
Go to Top |


