Reputation: 601
I have a website using Silverstripe CMS ( 3.6.1 ), Framework(3.6.1). I have a page with a big form with lots of fields. I am using the UserForms module (4.0).
My questions is: Can i format how those fields are displayed on template? Because I would like to use bootstrap grid so I can have a custom format: some rows to have 3 inputs ( col-md-4 ) and other rows to have ( col-md-6 ). Depending on the PSD format I have to convert.
EDIT1:
I have noticed that I can add Field inside Groups. So what I did was: for a row that has 3 inputs, I added a Group with 3 fields and so on.
Maybe this could help somehow ?
Upvotes: 1
Views: 761
Reputation: 24435
One option (nuclear) is you can copy the templates from the userforms/templates
folder into your theme, or mysite/templates
and modify them as required.
Be aware when doing this that you'll be responsible for backporting any changes as the userforms module gets updated underneath though.
You could also add extra CSS classes, if that is all you need, by using $editableFormField->ExtraClass .= 'col-md-6 col-sm-12';
etc. See here for where it gets used. I believe that the 4.0.x versions might not apply this on every field however, so I'd firstly advise upgrading to the latest version (currently 4.4.0).
For reference, the CWP "starter" theme uses Bootstrap and works with userforms - this involves some template duplication. Note that you may not be able to view this repository publicly.
Upvotes: 2