Jump to:

23361 Posts in 18124 Topics by 2862 members

General Questions

SilverStripe Forums » General Questions » Form styles

General questions about getting started with SilverStripe that don't fit in any of the categories above.

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

Page: 1
Go to End
Author Topic: 733 Views
  • Harley
    Avatar
    Community Member
    153 Posts

    Form styles Link to this post

    I have a site which in its header contains a form no more that two fields. I am trying to display these fields in a line but this is proving difficult because Silverstripe naturally wraps the form elements in divs each with a class.

    My question is this: can the classes be removed on this particular form only? I say this form only because there is another form on the same page so I don't want to just disable the form.css, simply I would just like to remove the classes for my first form.

    Can this be done and how?

    Any comments are much appreciated

  • Willr
    Avatar
    Forum Moderator
    5483 Posts

    Re: Form styles Link to this post

    You can customize the form template by providing a specific template file which has your own markup - http://doc.silverstripe.org/doku.php?id=form#using_a_custom_template or you should be able to style the divs to fit.

    Theres normally more than enough ID's and classes to use as styling hooks. If you want it on 1 line then make the form divs a fixed width and float them left.

    Usually even a semi complex set of CSS rules is easier than having a custom template for the form but you can do either.

  • Harley
    Avatar
    Community Member
    153 Posts

    Re: Form styles Link to this post

    Thanks Willr,

    I know what you mean, I would normally use the default Form.ss and manipulate with css but in this instance I need a custom form template so at least I now know I can do this.

    Thanks again

    733 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.