Jump to:

2012 Posts in 1438 Topics by 621 members

Form Questions

SilverStripe Forums » Form Questions » Incorporating Twitter Bootstrap Form Styles

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 1659 Views
  • kylehudson00
    Avatar
    Community Member
    22 Posts

    Incorporating Twitter Bootstrap Form Styles Link to this post

    Hey All,

    I'm currently playing around with the Twitter Bootstrap front-end kit for a new site I'm working on. The way forms are styled is particularly attractive and lightweight (see http://twitter.github.com/bootstrap/base-css.html#forms), but I'm a little stuck in terms of making it play nice with SilverStripe.

    Simply including the relevant CSS works as a starting point (basic text fields get formatted properly, for example), but certain elements require a little extra markup. Buttons, for example, need "btn" in the class attribute for the various button states to work.

    Can anyone point me in the right direction? Which files do I need to work with in order to customise the markup used in form generation?

  • Willr
    Avatar
    Forum Moderator
    5511 Posts

    Re: Incorporating Twitter Bootstrap Form Styles Link to this post

    The individual form field templates are hard coded in PHP and hard to replace easily in 2.*. In 3.0 they are available as templates so you can edit to your hearts content.

    If you're wanting to customize your own form classes you can use templates - http://doc.silverstripe.org/sapphire/en/topics/forms#using-a-custom-template

  • kylehudson00
    Avatar
    Community Member
    22 Posts

    Re: Incorporating Twitter Bootstrap Form Styles Link to this post

    Thanks very much, I'm still on 2.4.7 with this particular site so I just hacked some of the core files. Not ideal, obviously, but given that my next upgrade will be to 3.x, not a big deal. Thanks again for the reply.

    1659 Views
Page: 1
Go to Top

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

Comments on this website? Please give feedback.