We've moved! You can find modules, themes and widgets on http://addons.silverstripe.org.
This page will no longer be updated, and disappear soon. Module maintainers, please read our announcement to find out how to add your modules there.

Silverstripe FormFields [v0.01]

Maintainer(s): pasinter
Supported by: Not supported

 

Silverstripe FormFields offers an alternative approach to form rendering. Instead of relying on hardcoded tag generation, this module uses simple template files to generate form field tags. This allows easy customisation of forms without having to change a single line in the Silverstripe core.

 

 

Silverstripe FormFields offers an alternative approach to form rendering. Instead of relying on hardcoded tag generation, this module uses simple template files to generate form field tags. This allows easy customisation of forms without having to change a single line in the Silverstripe core.

Standard Silverstripe uses the Form.ss templateto render forms. Form.ss template calls the FormField::FieldHolder method which takes care of rendering the input tag:

<% control Fields >
$FieldHolder
<
end_control %>

Silverstripe FormFields moves the rendering into templates by using include statement. To enable Silverstripe FormFields, just change the above code to:

<% control Fields >
<
include FormField >
<
end_control %>

The above code just includes the FormField.ss template which renders the field. This is all that is required to take advantage of this module.

Note: the rendering of the field’s error messages has been modified in these tempaltes to conform to the jQuery’s validate plugin – http://docs.jquery.com/Plugins/Validation. All other functionality is still the same.

Note 2: Only fields of types textarea, text, email, password and listbox are rendered via templates. For all other fields Silverstripe FormFields falls back to the $FieldHolder functionality. This can bea easily tweaked in the FormField.ss template per your needs.

 

Release(s)

 
 

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.