How to change form layout to vertical?

  • LMKweb
  • Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
9 years 2 months ago #93627 by LMKweb
I feel like this is an easy answer, but can't find it anywhere. How do I change the form so that the items show up vertically, rather than horizontally? In playing around with the code inspector, when I changed class="form form-horizontal" to class="form form-vertical" it displayed as I would like. However, where do I make this change in the configuration?

Please Log in or Create an account to join the conversation.

More
9 years 2 months ago #93634 by James Riley
Replied by James Riley on topic How to change form layout to vertical?
You can do it with 1) a code edit; or 2) a quick CSS override of the "form .form-horizontal" selector (basically, a copy-and-paste of the "-vertical" selector's declaration block to make the "-horizontal" selector behave the same way). If you can post a link to a live sample page, I can provide you with the CSS code you'll need :)

James Riley .: EventBooking user since 2014 ::: JoomDonation user since 2016 :.
.: grfx & web design / IT / AV @ St. Therese Institute of Faith and Mission, Bruno, SK, Canada :.

Please Log in or Create an account to join the conversation.

  • LMKweb
  • Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
9 years 2 months ago #93636 by LMKweb
Replied by LMKweb on topic How to change form layout to vertical?
Thanks James - I don't necessarily want to override the horizontal style for all forms, just one in particular. Does each form have its own CSS ID, or is there a spot to add one for overriding just this form?

This is the page in question: www.thechildcarenetwork.org/conference/c...ividual-registration (and of course the same on the group registration form).

I see that the form ID is adminForm, but I was thinking that applies to all forms.

Please Log in or Create an account to join the conversation.

More
9 years 2 months ago #93640 by James Riley
Replied by James Riley on topic How to change form layout to vertical?
It looks like there is actually no "-vertical" class... so all that is really happening when you swap "vertical" for "horizontal" is that you are simply not applying the "-horizontal" rule-sets. So, really what we need to do is undo the declarations that "-horizontal" applies.

Try adding the following to your EB Custom CSS via [Event Booking -> Configuration -> Custom CSS tab]. Note: This will affect ALL the Event Booking Indiv / Group registration forms site wide, but ONLY these Event Booking forms and not any others.
Code:
#eb-individual-registration-page .form-horizontal .controls, #eb-group-registration-form .form-horizontal .controls { margin-left: 0; } #eb-individual-registration-page .form-horizontal .control-label, #eb-group-registration-form .form-horizontal .control-label { float: none; width: auto; } #eb-individual-registration-page .form-horizontal .control-group, #eb-group-registration-form .form-horizontal .control-group { margin-bottom: 10px; }

James Riley .: EventBooking user since 2014 ::: JoomDonation user since 2016 :.
.: grfx & web design / IT / AV @ St. Therese Institute of Faith and Mission, Bruno, SK, Canada :.
The following user(s) said Thank You: LMKweb

Please Log in or Create an account to join the conversation.

  • LMKweb
  • Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
9 years 2 months ago #93641 by LMKweb
Replied by LMKweb on topic How to change form layout to vertical?
Thanks, that worked! For some reason I thought there was a way to switch from vertical to horizontal in the back-end config, but that's probably in a different extension. They start to blend together after a little while! I dropped this code into the custom.css file in the media/com_eventbooking/assets/css folder, which is where I'd made edits previously. Is this the same place edits in the Custom CSS tab also display?

Please Log in or Create an account to join the conversation.

More
9 years 2 months ago #93642 by James Riley
Replied by James Riley on topic How to change form layout to vertical?
They are the same. The Config -> Custom CSS is just an easy way to access the Custom.CSS file for people that aren't familiar with editing files directly, just like EB's Translation Manager is an easy way to edit the /language/en-GB/en-GB.com_eventbooking.ini file (or whatever language localization your site uses if not en-GB).

James Riley .: EventBooking user since 2014 ::: JoomDonation user since 2016 :.
.: grfx & web design / IT / AV @ St. Therese Institute of Faith and Mission, Bruno, SK, Canada :.

Please Log in or Create an account to join the conversation.

More
9 years 2 months ago - 9 years 2 months ago #93643 by James Riley
Replied by James Riley on topic How to change form layout to vertical?
Regarding the existence of a switch to change between h & v layout, the "form-horizontal" appears to be hard-coded in the PHP files without any IF/CASE/etc conditional statements to control it (I checked that first before replying the first time :) ).

James Riley .: EventBooking user since 2014 ::: JoomDonation user since 2016 :.
.: grfx & web design / IT / AV @ St. Therese Institute of Faith and Mission, Bruno, SK, Canada :.
Last edit: 9 years 2 months ago by James Riley.

Please Log in or Create an account to join the conversation.

More
9 years 1 month ago #93746 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic How to change form layout to vertical?
Yes. You are correct. For this, I think create an override of the file components/com_eventbooking/view/register/tmpl/default.php to change the class for form tag would be easier. But it is your choice to use css :)

Tuan

Please Log in or Create an account to join the conversation.

Moderators: Tuan Pham Ngoc