Skip Navigation

[Resolved] Bootstrap view row indents

This support ticket is created 5 years, 7 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)

This topic contains 5 replies, has 2 voices.

Last updated by Christian Cox 5 years, 7 months ago.

Assisted by: Christian Cox.

Author
Posts
#1237258

I am trying to: Set layout so three columns on desktop, two on tablet, one on mobile.

Link to a page where the issue can be seen: hidden link

I expected to see: Three columns on desktop, two on tablet, one on mobile.

Instead, I got: Desktop has three columns but each row has a different indent? Can't get two columns on tablet working.

Please help!

#1237274

Hi, it looks like there is a markup issue because if you look at the page source you can see that each row is nested inside the previous row. That usually indicates an unmatched or unclosed div tag somewhere in the loop or the loop template. If you're not able to see anything obvious, please copy + paste the entire contents of the Loop Editor here for me to review. If you're using a template inside the loop, please paste those contents here as well.

#1237280

[wpv-layout-start]
[wpv-items-found]
<!-- wpv-loop-start -->
<wpv-loop wrap="3" pad="true">
[wpv-item index=1]
<div class="row ">
<div class="col-sm-6 col-md-4">[wpv-post-body view_template="loop-item-in-all-personal-stories"]</div>
[wpv-item index=other]
<div class="col-sm-6 col-md-4">[wpv-post-body view_template="loop-item-in-all-personal-stories"]</div>
[wpv-item index=3]
<div class="col-sm-6 col-md-4">[wpv-post-body view_template="loop-item-in-all-personal-stories"]</div>
[wpv-item index=pad]
<div class="col-sm-6 col-md-4"></div>
[wpv-item index=pad-last]
<div class="col-sm-6 col-md-4"></div>
</div>
</wpv-loop>
<!-- wpv-loop-end -->
[/wpv-items-found]
[wpv-no-items-found]
[wpml-string context="wpv-views"]No items found[/wpml-string]
[/wpv-no-items-found]
[wpv-layout-end]

Loop item:

<div class="storypreview">
<h4>[wpv-post-link]<br></h4>
<h5>[types field="storysubcategory"][/types] | [types field="storyabout"][/types]</h5>
[types field="image" class="storyimage"][/types]
<br><h6>[types field="snippet"][/types]
[wpv-post-read-more]</h6>
</div>

Thanks for your help

#1237317

You're missing a closing div tag at the end of the item index=3. When wrap=3, the third item should include a closing div tag to close the row. Here's the updated code:

[wpv-layout-start]
[wpv-items-found]
<!-- wpv-loop-start -->
<wpv-loop wrap="3" pad="true">
[wpv-item index=1]
<div class="row ">
<div class="col-sm-6 col-md-4">[wpv-post-body view_template="loop-item-in-all-personal-stories"]</div>
[wpv-item index=other]
<div class="col-sm-6 col-md-4">[wpv-post-body view_template="loop-item-in-all-personal-stories"]</div>
[wpv-item index=3]
<div class="col-sm-6 col-md-4">[wpv-post-body view_template="loop-item-in-all-personal-stories"]</div>
</div>
[wpv-item index=pad]
<div class="col-sm-6 col-md-4"></div>
[wpv-item index=pad-last]
<div class="col-sm-6 col-md-4"></div>
</div>
</wpv-loop>
<!-- wpv-loop-end -->
[/wpv-items-found]
[wpv-no-items-found]
[wpml-string context="wpv-views"]No items found[/wpml-string]
[/wpv-no-items-found]
[wpv-layout-end]
#1237354

Thanks, that's remediated the indent issue.
However, when switching to tablet mode where there are two stories per row, there is one left hanging. Two stories in first row, one in second [repeat].
Is there a way round that?

#1237356

That's how Bootstrap's grid works, in general. It doesn't break one row apart to fill in space left by the previous row:
https://getbootstrap.com/docs/3.3/css/#grid

You can try removing the div with the row class, and removing the corresponding closing div tags in index=3 and index=pad-last. Without the row div, the cells can flow freely from one row to the next.