One column div list template with one row

Hello,

Using the div list template in a one-column way, I noticed that there is a <div> missing at the end of the template when the list has only one row... which is a problem because I breaks my template.

This problem disappears if there is more than one row... or if there is 0 row.

I got rid of it with this little patch in the div template after the row foreach :
Code:
if (count($items) == 1):
        echo '</div>';
    endif;

... but just wanted to know if it's something you can reproduce or if it's just on my side.
 
Can you try editing ./components/com_fabrik/helpers/html.php, around line 2252 in the bootstrapGrid() function you should find:

Code:
if ($i + 1 % $columns !== 0)
Try making that ...
Code:
if (($i == 0 && $columns == 1) || $i + 1 % $columns !== 0)
... and see if that fixes it. I think the problem is in that loop, with just the corner case of having a single row with only one column.

You'll have to take your fix out of the template as well.

-- hugh
 
Hello,

Yes, I confirm that your fix is working, thanks Hugh !
Maybe it would have its place in the next Fabrik package... ;-)
 
Last edited:
I think the last <div class="row-fluid"> is never closed inside the loop (there is always an item added to $grid after adding endline + newline ), no matter how much columns or items
So $grid[] = '</div><!-- grid close end row -->'; should be added without condition.
 
Update :
Both of your solutions work with the case 1 column + 1 row but don't work with 1 column + 0 row
... it seems that everything's ok when there is more than 1 row
 
Ah, yes, with no data there's no rowfluid to close.
Code:
        if (!empty($items))
        {
            // Close opened and unfinished row.
            $grid[] = '</div><!-- grid close end row -->';
        }
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top