[html-formfu] Bootstrap forms again...

Carl Franks fireartist at gmail.com
Fri May 31 15:20:38 GMT 2013

After the last message a few weeks ago, I added some new methods to
help with class name customization - but was then ill for a while, and
forgot all about it...!
I've pushed what I've done to github, but I'm not sure whether any of
it will be useful to you.

It'd be really helpful if you could send your custom tt files (or push
them to a branch on github)
or give an example of exactly how you want the markup to differ than
it currently is.


On 29 May 2013 17:35, Nigel Metheringham <nigel at dotdot.it> wrote:
> Like various other people, I hit the difficulty lining up FormFu's form
> generation and Bootstrap.
> I did get it working OK with tt based HTML generation, and actually very
> minor changes - although I have effectively hardwired to horizontal forms -
> see http://twitter.github.io/bootstrap/base-css.html#forms - and inline
> checkboxes.
> However I think if the class addition was removed from the form tag, the
> horizontal forms would revert to "normal" even with the additional label
> markup, and the inline checkboxes are similarly a case of just change an
> attribute.
> So, the only changes from the default form tt files were:-
>   - start_form - tweaked the classes on the form tag
>     possibly doable with just attributes
>   - textarea_tag - wrapped an extra div around for use with
>     ckeditor (unrelated to bootstrap really)
>   - field - the main label/control-group changes for bootstrap
>   - checkboxgroup_tag - rework for inline checkboxes
> I've not spent a batch of time profiling speed with this - its good enough
> for my use.  The tt could be made faster by reusing the tt object I already
> have in place for the app - in fact I suspect I could probably do this by
> changing the
>   [% form.render %]
> in those templates to something that does form.render_data and then just
> calls PROCESS on the templates (would then get all the templates into my
> cache too).
> In terms of just making a new bootstrap renderer within the classes, it
> should be easily doable by having it use the string renderer everywhere
> except the 4 places mentioned above.
> The form definitions have also changed slightly - but only in that I have
> added some class attributes to some elements (mainly to force them wider -
> attributes => {class => 'span6'} - or to make the form buttons prettier.
>         Nigel.
> --
> [ Nigel Metheringham ------------------------------ nigel at dotdot.it ]
> [                 Ellipsis Intangible Technologies                  ]
> _______________________________________________
> HTML-FormFu mailing list
> HTML-FormFu at lists.scsys.co.uk
> http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/html-formfu

More information about the HTML-FormFu mailing list