1956 Posts in 1235 Topics by 602 members
|Go to End|
4 April 2012 at 3:01pm
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?
5 April 2012 at 10:55pm
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
23 April 2012 at 11:16am
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.
|Go to Top|