Skip Navigation

[Resolved] Limit Grid on Mobile View

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
- 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: Asia/Karachi (GMT+05:00)

This topic contains 6 replies, has 2 voices.

Last updated by Pete 5 years, 2 months ago.

Assisted by: Waqar.

Author
Posts
#1318557
aaa see 3 col.png

Hi there,

On this test custom post type: hidden link

When viewed on an iPad the 3 column gird is very squashed. There are only 2 showing at the moment, we are due to add more shortly. Is it possible to have 3 columns on PC, and just 2 on iPad?

Worth an ask as we have done some digging about and couldn't find anything ref this.

Thanks, P

#1318739

Hi Pete,

Thank you for contacting us and I'd be happy to assist.

Since the view in question is using Bootstrap to control the grid layout, this can be easily achieved by adjusting the grid class names.

In your view's "Loop Editor" section, you'll see one or more instances of div with class "col-sm-4".

Example:


<div class="col-sm-4">

You can update all those instances to:


<div class="col-md-4 col-sm-6">

In Bootstrap's grid system, the available width is distributed in 12 equal columns. The div with class "col-sm-4" means that the individual item should be shown covering 4 of those columns ( 1/3 ), on small and large screen devices.

When you'll change it to "col-md-4 col-sm-6", it would translate to using 4 columns (1/3 ) on medium and large screens, but use 6 columns ( 1/2 ), on smaller screens.

I hope this helps and you can learn more about the Bootstrap's grid layout from its official documentation:
hidden link

regards,
Waqar

#1318755

Thank you Waqar,

Didn't know you could add more than one class like this, resulting in the layouts being adjusted depending on the screen size.

While Toolset seems 'crazy' complicated, it's certainly very flexible.

Thanks for your help ref sorting this 🙂

Have a great day. Pete

#1318853

Sorry to reopen this however I have tried what you suggested on another page and it doesn't work like it did on the previous page.

On this page: hidden link

I have added to the Loop Editor, the same however on smaller devices the grid maintains 3 cols wide rather than going down to 2.

This is the rived code with the col-sm-6 added:

<!-- wpv-loop-start -->
<wpv-loop wrap="3" pad="true">
[wpv-item index=1]
<div class="row ">
<div class="col-sm-4 col-sm-6">[wpv-post-body view_template="loop-item-in-home-page-search-bar"]</div>
[wpv-item index=other]
<div class="col-sm-4 col-sm-6">[wpv-post-body view_template="loop-item-in-home-page-search-bar"]</div>
[wpv-item index=3]
<div class="col-sm-4 col-sm-6">[wpv-post-body view_template="loop-item-in-home-page-search-bar"]</div>
</div>
[wpv-item index=pad]
<div class="col-sm-4 col-sm-6"></div>
[wpv-item index=pad-last]
<div class="col-sm-4 col-sm-6"></div>
</div>
</wpv-loop>
<!-- wpv-loop-end -->

#1318905

Hi Pete,

Thanks for the update and glad you liked the Bootstrap grid's flexibility.

On your other page ( hidden link ), I've noticed that class names used for the wrappers are:


<div class="col-sm-4 col-sm-6">

Please update them all to:


<div class="col-md-4 col-sm-6">

regards,
Waqar

#1318991
AAA see small screen.png

Goodness, just when Toolset couldn't get anymore complicated 🙂

That worked...I guess...thank you.

Is there a way fo changing the breakpoint for just this grid?

On a smaller laptop the grid starts to get squashed 'before' they grid snaps to two columns wide.

If not, I'll need to rethink if two wide would be better than 3.

Worth an ask.

Thank you Waqar.

#1319871

My issue is resolved now. Thank you!