1. Michel Ollivier
  2. Sherlock Holmes
  3. Newbie area
  4. Friday, 26 June 2015
  5.  Subscribe via email
Hi Daniel,

Concerning edit form view, fields are displayed by default with label class .col-sm-2 and input .col-sm-10. Is there a way to change this?

For exemple in custom field override

					
<?php if($this->form->getGroup('customfields')) : ?>
<?php foreach($this->form->getGroup('customfields') as $custom) : ?>
<div class="form-group">
<div class="col-sm-2">
<?php echo $custom->label; ?>
</div>
<div class="col-sm-10">
<?php echo $custom->input; ?>
</div>
</div>
<?php endforeach; ?>
<?php endif; ?>


generates


<div id="custom-fields">
<div class="form-group">
<div class="col-sm-2">
<label class="required" for="jform_customfields_hideaddress" id="jform_customfields_hideaddress-lbl">
Hide Address<span class="star"> *</span></label> </div>
<div class="col-sm-10">
<select aria-required="true" required="" class="form-control required" name="jform[customfields][hideaddress]" id="jform_customfields_hideaddress">
<option value="Yes">Yes</option>
<option selected="selected" value="No">No</option>
</select>
</div>
</div>
<div class="form-group">
<div class="col-sm-2">
<label class="required" for="jform_customfields_hidemap" id="jform_customfields_hidemap-lbl">
Hide Map<span class="star"> *</span></label> </div>
<div class="col-sm-10">
<select aria-required="true" required="" class="form-control required" name="jform[customfields][hidemap]" id="jform_customfields_hidemap">
<option value="Yes">Yes</option>
<option selected="selected" value="No">No</option>
</select>
</div>
</div>
<div class="form-group">
<div class="col-sm-2">
<label class="required" for="jform_customfields_anonymous" id="jform_customfields_anonymous-lbl">
Anonymous<span class="star"> *</span></label> </div>
<div class="col-sm-10">
<select aria-required="true" required="" class="form-control required" name="jform[customfields][anonymous]" id="jform_customfields_anonymous">
<option value="Yes">Yes</option>
<option selected="selected" value="No">No</option>
</select>
</div>
</div>
<div class="form-group">
<div class="col-sm-2">
<label class="" for="jform_customfields_weekprice" id="jform_customfields_weekprice-lbl">
Week Price</label> </div>
<div class="col-sm-10">
<input type="text" class="form-control" value="" id="jform_customfields_weekprice" name="jform[customfields][weekprice]"> </div>
</div>
<div class="form-group">
<div class="col-sm-2">
<label class="" for="jform_customfields_dailyprice" id="jform_customfields_dailyprice-lbl">
Daily Price</label> </div>
<div class="col-sm-10">
<input type="text" class="form-control" value="" id="jform_customfields_dailyprice" name="jform[customfields][dailyprice]"> </div>
</div>
<div class="form-group">
<div class="col-sm-2">
<label class="required" for="jform_customfields_bedrooms" id="jform_customfields_bedrooms-lbl">
Bedrooms<span class="star"> *</span></label> </div>
<div class="col-sm-10">
<select aria-required="true" required="" class="form-control required" name="jform[customfields][bedrooms]" id="jform_customfields_bedrooms">
<option value="1">1</option>
<option selected="selected" value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
<option value="6">6</option>
<option value="7">7</option>
<option value="8">8</option>
<option value="9">9</option>
<option value="10">10</option>
</select>
</div>
</div>
<div class="form-group">
<div class="col-sm-2">
<label class="required" for="jform_customfields_bathrooms" id="jform_customfields_bathrooms-lbl">
Bathrooms<span class="star"> *</span></label> </div>
<div class="col-sm-10">
<select aria-required="true" required="" class="form-control required" name="jform[customfields][bathrooms]" id="jform_customfields_bathrooms">
<option selected="selected" value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
</select>
</div>
</div>
<div class="form-group">
<div class="col-sm-2">
<label class="" for="jform_customfields_petsallowed" id="jform_customfields_petsallowed-lbl">
Pets Allowed</label> </div>
<div class="col-sm-10">
<select class="form-control" name="jform[customfields][petsallowed]" id="jform_customfields_petsallowed">
<option value="Yes">Yes</option>
<option selected="selected" value="No">No</option>
</select>
</div>
</div>
<div class="form-group">
<div class="col-sm-2">
<label class="required" for="jform_customfields_currency" id="jform_customfields_currency-lbl">
Currency<span class="star"> *</span></label> </div>
<div class="col-sm-10">
<select aria-required="true" required="" class="form-control required" name="jform[customfields][currency]" id="jform_customfields_currency">
<option selected="selected" value="USD">USD</option>
<option value="EUR">EUR</option>
<option value="GBP">GBP</option>
</select>
</div>
</div>
<div class="form-group">
<div class="col-sm-2">
<label class="required" for="jform_customfields_minimumstay" id="jform_customfields_minimumstay-lbl">
Minimum Stay<span class="star"> *</span></label> </div>
<div class="col-sm-10">
<select aria-required="true" required="" class="form-control required" name="jform[customfields][minimumstay]" id="jform_customfields_minimumstay">
<option value="3 days">3 days</option>
<option selected="selected" value="1 week">1 week</option>
<option value="2 weeks">2 weeks</option>
</select>
</div>
</div>
<div class="form-group">
<div class="col-sm-2">
<label class="" for="jform_customfields_bookingcom" id="jform_customfields_bookingcom-lbl">
booking.com</label> </div>
<div class="col-sm-10">
<input type="url" value="" id="jform_customfields_bookingcom" class="form-control" name="jform[customfields][bookingcom]"> </div>
</div>
<div class="form-group">
<div class="col-sm-2">
<label class="" for="jform_customfields_homeawaycom" id="jform_customfields_homeawaycom-lbl">
homeaway.com</label> </div>
<div class="col-sm-10">
<input type="url" value="" id="jform_customfields_homeawaycom" class="form-control" name="jform[customfields][homeawaycom]"> </div>
</div>
</div>


I would like to place more precisely form elements in a responsive grid. On previous project I used jquery appendTo method to place fields accurately. But it's too heavy. This time, I will try server side method.

Thanks for your help;

Regards
Michel
Responses (7)


There are %s replies to this question. If you want to see them you need a valid subscription.
If you have a valid subscription, please login now.
Visit store now

Last questions

CMigrator: Path from Drupal 6 to J5?
(Category s/b CMigrator, but didn't see it on the list) I'm interested in usi...
0 Replies
Posted on Monday, 28 April 2025
  • New
  • Dowload all Hotspots entries
    Hi there, I'm looking for a way to dowload all the Hotspots entries. I've got t...
    0 Replies
    Posted on Sunday, 06 April 2025
    • #kml
    • #download
    Set number of hotspots / user groups
    Hi, I'm working with Hotspots for my new website and I love it! After trying ...
    0 Replies
    Posted on Monday, 31 March 2025
    J5 compatibility for Hotspots
    Hi guys, Just started to update my old J3x website. Is there J5 compatibility p...
    1 Replies
    Posted on Monday, 24 February 2025
    • #Hotspots
    • #hotspots Joomla 5
    Text size in the comment input form
    Hello. How can I increase the font size in the comment input field? For examp...
    0 Replies
    Posted on Wednesday, 26 February 2025
    • #CComment 6