Skip Navigation

[Resolved] Grid/View/Layout expands beyond available content area. What am I doing wrong?

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

Problem:

CSS class name ".container-fluid" and ".row" are missing in Views bootstrap grid layout mode.

Solution:

You can add them manually, for example:

https://toolset.com/forums/topic/grid-view-layout-expands-beyond-available-content-area-what-am-i-doing-wrong/#post-1140271

Relevant Documentation:

https://getbootstrap.com/docs/3.3/css/#grid-example-fluid

This support ticket is created 6 years, 2 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/Hong_Kong (GMT+08:00)

This topic contains 4 replies, has 2 voices.

Last updated by joe-enteleos 6 years, 1 month ago.

Assisted by: Luo Yang.

Author
Posts
#1139818
Screenshot - 11_4_2018 , 12_18_52 PM.jpg
Screenshot - 11_4_2018 , 11_56_58 AM.jpg
Screenshot - 11_4_2018 , 11_47_08 AM.jpg

I'm doing a simple thing, using Layouts to show post title, featured image, and a list of child posts. I've created a couple different views for the child posts, using the Loop Wizard to create a Grid layout, no changes to the code. One is a single column, while the other is three columns.

In both cases, the width on the front end expands beyond the content area of the post. I've attached some screen shots showing the layout editor and what shows on the front end. Here is the Views code:

[wpv-layout-start]
    [wpv-items-found]
        <!-- wpv-loop-start -->
	<div class="container wpv-loop js-wpv-loop">
	<wpv-loop wrap="3" pad="true">
		[wpv-item index=1]
		<div class=" ">
			<div class="col-sm-4">[wpv-post-body view_template="Loop item in State Group list of states"]</div>
		[wpv-item index=2]
			<div class="col-sm-4">[wpv-post-body view_template="Loop item in State Group list of states"]</div>
		[wpv-item index=3]
			<div class="col-sm-4">[wpv-post-body view_template="Loop item in State Group list of states"]</div>
		</div>
		[wpv-item index=pad]
			<div class="col-sm-4"></div>
		[wpv-item index=pad-last]
			<div class="col-sm-4"></div>
		</div>
	</wpv-loop>
	</div>
	<!-- wpv-loop-end -->
    [/wpv-items-found]
    [wpv-no-items-found]
        <strong>[wpml-string context="wpv-views"]No items found[/wpml-string]</strong>
    [/wpv-no-items-found]
[wpv-layout-end]

Can you tell me what might be the problem?

Here is the page: hidden link

Oh, and by the way. The Layouts row is set to "Row as wide as post content."

#1140271
container.JPG

Hello,

Please try to modify this line from:

<div class="container wpv-loop js-wpv-loop">

To:

<div class="container-fluid  wpv-loop js-wpv-loop">

from:

<div class=" ">

To:

<div class="row">

See screenshot: container.JPG

More help:
hidden link
To nest your content with the default grid, add a new .row and set of .col-sm-* columns within an existing .col-sm-* column.

#1141047

Thank you Luo,

Yes, that does fix the problem. Can you say why the Views loop wizard makes the empty class declaration for the row div? Is that a bug, or is it by design? Should I be on the lookout for that in all code produced by the loop wizard?

Also, is there an option in the Views loop wizard to choose the fluid container? Or is there an option I missed in Layouts? Or is setting a fluid container something that must always be done manually?

Thank you for any further clarification.

Joe

#1141185

Dear Joe,

Q1) empty class declaration for the row div,

It is a known issue, see the errata here:
https://toolset.com/errata/view-loop-output-bootstrap-grid-missing-div-and-class/

Q2) container-fluid, there isn't such a built-in feature within Layouts plugin, and it is already in our feature request list:
https://toolset.com/feature-request/allow-to-alter-the-div-class-and-id-generated-by-layouts-i-e-container-and-container-fluid/

I suggest place your vote on it
https://toolset.com/feature-request/?wpv_post_search=container-fluid&wpv_view_count=686737

#1141765

Great. I've added my vote. And thank you for the extra info on the bug, I look forward to the update.