Still in heavy development
Due to some limitations, this may not work the way I want it, so the API will be changing frequently until I am happy with it. Please use with caution if you must use it at all., (*1)
Milkyway Form Fields is a set of form fields that we use across a variety of projects and didn't think we would need a separate module for each., (*2)
Install
Add the following to your composer.json file, (*3)
"require" : {
"milkyway-multimedia/ss-mwm-formfields": "dev-master"
}
Usage
Composite Fields
These fields work as composite fields, with the ability to group form fields into certain components, (*4)
- HasOneCompositeField: Save a has one relationship as if it is part of the current form. Can also be used to completely save a different record if need be.
- InlineFormField: Save a form as part of another form (kind of like ajaxing it).
- AccordionComponentField: A composite field that acts like an accordion. Uses Twitter Bootstrap styling.
- ModalWindowField: A composite field that acts like a modal window, with the option to set a trigger, or to trigger automatically. Uses Twitter Bootstrap styling.
- PanelComponentField: A composite field that displays as a panel
- SliderComponentField: A composite field that displays a slider. Uses Twitter Bootstrap styling.
- TabComponentField: A composite field that displays fields in a tab. Uses Twitter Bootstrap styling.
Helper Fields
These are fields that use the LiteralField as a base, but are just there to make developing with forms a little bit faster (and more zen), (*5)
- FormActionLink: Display a link like a button - uses Twitter Bootstrap styling - to get it to work in the CMS, make sure you use FormActionLink::create($name, $content, $link)->cms()
- FormMessageField: Display a message to the user - uses Twitter Bootstrap styling - to get it to work in the CMS, make sure you use FormMessage::create($name, $content, $type)->cms()
- HorizontalRuleField: Display a horizontal rule, or just separate with blank paragraphs by using SpacerField::create($name)->invisible()
- IframeField: Display a page in an iframe within the form
- FlyoutLabelField: Display a label in a flyout number, to better match the Silverstripe CMS styling.
Functional Fields
- GroupedListboxField: Allows you to use a two dimensional array with ListboxField
- RangeSliderField: Display a slider that saves values to the database
- TabbedSelectionGroup: Display selection groups in tabs, or a tab dropdown (to save space)
- Select2Field
- TypeAheadField
Extended Functionality
- HTMLEditorField - extras: Adds ability to limit characters on HTMLEditorFields, define more custom configuration such as buttons, iframe CSS and more.
License
Version
Develop
This project relies on the mwm.buildr module.
This means you can develop the code with live updating and automatic building on file changes,
simply run the command below to get this functionality., (*6)
gulp --dev
For more information about this functionality, please read:
https://bitbucket.org/milkyway-multimedia/mwm.buildr/raw/master/README.md, (*7)
- Homepage: http://milkywaymultimedia.com.au
- E-mail: mell@milkywaymultimedia.com.au
- Twitter: @mwmdesign