2017 © Pedro Peláez
 

silverstripe-module silverstripe-bootstrap-forms

An extension to add CSS classes to Silverstripe forms to play nicer with Twitter Bootstrap

image

axllent/silverstripe-bootstrap-forms

An extension to add CSS classes to Silverstripe forms to play nicer with Twitter Bootstrap

  • Tuesday, February 6, 2018
  • by axllent
  • Repository
  • 2 Watchers
  • 2 Stars
  • 1,579 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 8 Versions
  • 13 % Grown

The README.md

Add CSS classes to Silverstripe forms to play nicer with Twitter Bootstrap

An extension to add CSS classes to Silverstripe forms to "play nicer" with Twitter Bootstrap, mostly by adding the form-control bootstrap CSS classes to form elements (input, dropdown, submit etc)., (*1)

This is designed to be a plug-and-play extension, without requiring you to change your existing forms on your website. This includes all forms such as login forms, password reset forms, as well as any other form you have created., (*2)

It extends FormField to try provide a transparent "manipulation" of the rendered form fields, adding some bootstrap CSS to the rendered fields. It does not produce bootstrap-specific html for your forms., (*3)

FormField unfortunately only has a $this->extend('onBeforeRender', $this); in Field that allows manipulation of the field itself, and not the parent field_holder. This allows only a very limited amount of flexibility, and prevents an extension from changing the field_holder., (*4)

Form submit buttons get a btn btn-primary class added, and any other buttons get a btn btn-default class added., (*5)

Forms will still need some additional CSS styling (to set spacing) as the form's field_holders cannot be modified to the limitations mentioned above., (*6)

Features

It adds the form-control CSS class to all front-end: - TextField (and extended classes) - TextAreaField - DropdownField, (*7)

It renders CheckboxSetField & OptionsetField with different field templates (see templates/Forms)., (*8)

It does not: - Modify field holders (onBeforeRender() does not allow that) - Support FieldGroup (you'll need to use CSS to do that) - Apply bootstrap-specific CSS classes to form messages, (*9)

Requirements

  • Silverstripe ^4 || ^5

Installation

Install via Composer

You can install it via composer with composer require axllent/silverstripe-bootstrap-forms, (*10)

Basic usage

Simply install (and flush), add the checkbox CSS to your styles and you're good to go., (*11)

The Versions

06/02 2018

dev-silverstripe3

dev-silverstripe3 https://github.com/axllent/silverstripe-bootstrap-forms

An extension to add CSS classes to Silverstripe forms to play nicer with Twitter Bootstrap

  Sources   Download

MIT The MIT License (MIT)

The Requires

 

bootstrap silverstripe forms

06/02 2018

dev-master

9999999-dev https://github.com/axllent/silverstripe-bootstrap-forms

An extension to add CSS classes to Silverstripe forms to play nicer with Twitter Bootstrap

  Sources   Download

MIT The MIT License (MIT)

The Requires

 

bootstrap silverstripe forms

17/10 2017

2.0.2

2.0.2.0 https://github.com/axllent/silverstripe-bootstrap-forms

An extension to add CSS classes to Silverstripe forms to play nicer with Twitter Bootstrap

  Sources   Download

The MIT License (MIT)

The Requires

 

bootstrap silverstripe forms

04/09 2017

2.0.1

2.0.1.0 https://github.com/axllent/silverstripe-bootstrap-forms

An extension to add CSS classes to Silverstripe forms to play nicer with Twitter Bootstrap

  Sources   Download

The MIT License (MIT)

The Requires

 

bootstrap silverstripe forms

19/06 2017

2.0.0

2.0.0.0 https://github.com/axllent/silverstripe-bootstrap-forms

An extension to add CSS classes to Silverstripe forms to play nicer with Twitter Bootstrap

  Sources   Download

The MIT License (MIT)

The Requires

 

bootstrap silverstripe forms

18/08 2016

1.1.1

1.1.1.0 https://github.com/axllent/silverstripe-bootstrap-forms

An extension to add CSS classes to Silverstripe forms to play nicer with Twitter Bootstrap

  Sources   Download

The MIT License (MIT)

The Requires

 

bootstrap silverstripe forms

18/08 2016

1.1.0

1.1.0.0 https://github.com/axllent/silverstripe-bootstrap-forms

An extension to add CSS classes to Silverstripe forms to play nicer with Twitter Bootstrap

  Sources   Download

The MIT License (MIT)

The Requires

 

bootstrap silverstripe forms

21/07 2016

1.0.0

1.0.0.0 https://github.com/axllent/silverstripe-bootstrap-forms

An extension to add CSS classes to Silverstripe forms to play nicely with Twitter Bootstrap

  Sources   Download

The MIT License (MIT)

The Requires

 

bootstrap silverstripe forms