Skip Navigation

[Resolved] conditional bootsrap columns

This support ticket is created 4 years, 6 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.

Our next available supporter will start replying to tickets in about 3.08 hours from now. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 - - 9:00 – 13:00
14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 - - 14:00 – 18:00

Supporter timezone: Africa/Casablanca (GMT+01:00)

This topic contains 1 reply, has 2 voices.

Last updated by Jamal 4 years, 6 months ago.

Assisted by: Jamal.

Author
Posts
#1608513
Capture.PNG

i have a bootsrap view here:
hidden link

"Our Locations" is the view in question, and it's looping a repeating field group. you can see that only 2 items are listed, but it is a 4 column bootstrap view. I am wondering if it is possible to go to a 2 column boostrap view when there are only 2 items, and a 3 column view if there are only 3 items?

#1608869

Hello and thank you for contacting the Toolset support.

Currently, Toolset does not offer a way to count the number of items on a repeating field. You will have to create a function or shortcode that will return the count. Then use the count inside conditional shortcodes to display different styles for each count.

Check an example of a shortcode that counts the number of items on a repeating field here hidden link

You will have to register the function in Toolset->Settings->Frontent Content, to make it available inside conditional shortcodes. Then use shortcodes to display different styles for each count. https://toolset.com/documentation/user-guides/views/conditional-html-output-in-views/

I hope this helps. Let me know if you have any questions.