Skip Navigation

[Resolved] Display cred taxonomy inline

This thread is resolved. Here is a description of the problem and solution.

Problem: I have a custom taxonomy field displayed as checkboxes in a Form. I would like the checkboxes to appear inline instead of one per line.

Solution: Use Bootstrap 4's inline form element classes to force an inline display.

Relevant Documentation:
https://getbootstrap.com/docs/4.3/components/forms/#inline

This support ticket is created 5 years, 3 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

Tagged: 

This topic contains 8 replies, has 2 voices.

Last updated by Mario 5 years, 3 months ago.

Assisted by: Christian Cox.

Author
Posts
#1349425

Tell us what you are trying to do?
Display cred taxonomy inline

<div class="form-group ">
<label>Do you have experiences providing any of these services?</label>
[cred_field field='p-experience' force_type='taxonomy' output='bootstrap' display='checkbox']
</div>

Is there any documentation that you are following?
https://toolset.com/forums/topic/styling-filter-checkboxes/

I have tried using the example but has not worked.

#1349517

The example isn't for CRED, it's for a custom search View's filter. Is your site using Bootstrap 4? If so, I can show you how to implement their inline forms like shown here: https://getbootstrap.com/docs/4.3/components/forms/#inline

#1349555

Hi Chris
I have change Bootstap loading from 3 to 4.

Yes, some assistance would be great.

#1349557

You'll have to use expert mode in the Form builder. Wrap your taxonomy shortcode in a div with the class "tssupp-inline":

<div class="tssupp-inline">
  [cred_field field='your-taxonomy-slug' force_type='taxonomy' output='bootstrap' display='checkbox']
</div>

Then in the Form's JS panel, add some custom code to add the form-check and form-check-inline classes to each list item:

jQuery(document).ready(function($) {
    setTimeout(function() {
        $('.tssupp-inline li.checkbox').addClass('form-check form-check-inline');
    }, 500 );
});

That should implement Bootstrap 4's inline checkboxes display. Let me know if you have questions about that.

#1349559

Excellent. Is there a way to put a border around the taxonomy?

#1349563

I'm not sure I know exactly where you want the border, but you can use CSS like so:

.tssupp-inline {
  border:1px solid black;
}

Or wrap your taxonomy shortcode in another element and apply your styles there.

#1349569

The code below - raps all the taxonomies in one box rather than each taxonomy.

<div class="tssupp-inline">
<div class="boarder-tax">
[cred_field field='p-service' force_type='taxonomy' output='bootstrap' display='checkbox']
</div>
</div>

.boarder-tax {
border:1px solid black;
}

#1349573

You could add the border to the form-check-inline class, or target the list item inside the boarder-tax class instead.

#1349575

My issue is resolved now. Thank you!