Area Layout being wrapped in erroneous row?

Permalink
I've been struggling to get concrete 5.7.5.5 to generate the correct HTML. I'm getting this HTML:

<div class="container">
  <div class="row">
    <div class="12u">
      <div class="row">
        <div class="4u">...</div>
        <div class="4u">...</div>
        <div class="4u">...</div>
      </div>
    </div>
  </div>
</div>


I want to get this:

<div class="container">
  <div class="row">
    <div class="4u">...</div>
    <div class="4u">...</div>
    <div class="4u">...</div>
  </div>
</div>


I can't figure out why the erroneous row is being added. If I remove enableGridContainer() from the theme, it removes the erroneous row, but also removes the container.

Has anybody else seen this and know a fix?

 
bram1028 replied on at Permalink Reply
Well, I just created a trial site with the Elemental theme, and the problem exists there, too...

I guess this is either by design or a bug.
MrKDilkington replied on at Permalink Reply
MrKDilkington
Hi bram1028,

Please include your grid framework PHP class code as an attachment or in a reply.
bram1028 replied on at Permalink Reply
Here's my GridFramework, but the problem exists with the built-in frameworks as well.
<?php
namespace Concrete\Package\Roney\Src;
use Concrete\Core\Page\Theme\GridFramework\GridFramework;
defined('C5_EXECUTE') or die(_("Access Denied."));
class RoneyGridFramework extends GridFramework
{
    public function getPageThemeGridFrameworkName()
    {
        return t('Roney');
    }
    public function getPageThemeGridFrameworkRowStartHTML()
    {
        return '<div class="row">';
    }
    public function getPageThemeGridFrameworkRowEndHTML()
MrKDilkington replied on at Permalink Reply
MrKDilkington
@bram1028

What are the steps to recreate your first example?
bram1028 replied on at Permalink Reply
You can recreate this by signing up for a trial SimpleSite using Elemental theme.

Create a new Blank page. Add a Area Layout to the Main Area with 2 columns using Bootstrap grid.

The generated code is this:

http://test4.y0xx.cloud.concrete5.io/test...

<div class="container”>
  <div class="row”>               <!-- This row (and column) is unnecessary -->
    <div class="col-sm-12”>
      <div class="row”>
        <div class="col-sm-6”>
          <p>Column 1</p>
        </div>
        <div class="col-sm-6">
          <p>Column 2</p>
        </div>
      </div>
    </div>
  </div>
</div>
MrKDilkington replied on at Permalink Reply
MrKDilkington
@bram1028

I understand what you are describing and am not sure why it is there.

Maybe someone else will have some information on the topic.

In the meantime, I and maybe others, can look at the code for how the columns are added.
bram1028 replied on at Permalink Reply
I just found where it's coming from.

concrete/elements/block_header_view.php:36

$gf = $pt->getThemeGridFrameworkObject();
    print $gf->getPageThemeGridFrameworkContainerStartHTML();
    //print $gf->getPageThemeGridFrameworkRowStartHTML();
    //printf('<div class="%s">', $gf->getPageThemeGridFrameworkColumnClassesForSpan(
    //    min($a->getAreaGridMaximumColumns(), $gf->getPageThemeGridFrameworkNumColumns())
    //));


concrete/elements/block_footer_view.php:22

$gf = $pt->getThemeGridFrameworkObject();
    //print '</div>';
    //print $gf->getPageThemeGridFrameworkRowEndHTML();
    print $gf->getPageThemeGridFrameworkContainerEndHTML();


I commented out the indicated lines and the problem is fixed. I just need to do some regression testing to make sure it doesn't break anything else.

I think I will report this on Github. It should only be adding the container, not a row/column.
bram1028 replied on at Permalink Reply
I found this closed issue in Github:https://github.com/concrete5/concrete5/issues/1328...

I still believe this behavior is wrong. The container should be added, but now the row.

This website stores cookies on your computer. These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media. To find out more about the cookies we use, see our Privacy Policy.