Skip Navigation

[Resolved] Bootstrap 4 views

This support ticket is created 5 years, 5 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
- 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 -
- 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 -

Supporter timezone: Europe/London (GMT+00:00)

This topic contains 2 replies, has 2 voices.

Last updated by martinH-10 5 years, 5 months ago.

Assisted by: Nigel.

Author
Posts
#1300401
2019-07-25_12-12-37.png

Hello, I have installed new types and views and started to using Bootstrap 4.

I was expecting that views will no more use col-md-number but it will use only col col-md col-xs etc..

I tried to delete the numbers and view works well. Is it okay to delete the col numbers in views?

#1300527

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

In Bootstrap 4 you don't have to specify the number of columns in a row with the class names, you can just keep adding .col divs to squeeze in more columns. But you can still declare the number of columns a div should occupy (out of 12 available columns in a row).

You can see the difference in this simple codepen demo: hidden link

Note that the second row wrongly tries to add four columns when the .col-sm-4 class dictates that only 3 are available.

When you choose Bootstrap columns as the output format of a View you *are* specifying the number of columns, and because the markup is generated mechanically by the iterations of the Loop it is somewhat rigid and it makes sense for the class names to include the number of columns, but it will actually achieve the same result if you edit it to remove them (because Views will be adding the correct number of columns to each row in any case).

So feel free to edit the class names.

#1300709

Cool Nigel, I know the difference, I was just asking. Nice to know, how the loop works with it. Thanks