Created
December 20, 2021 19:00
-
-
Save hissy/6b32e6f190c28d60f42a91a8ecade3d6 to your computer and use it in GitHub Desktop.
#ConcreteCMS #Containers Dynamic Grid Columns Container example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
defined('C5_EXECUTE') or die("Access Denied."); | |
/** @var $c \Concrete\Core\Page\Page */ | |
/** @var $container \Concrete\Core\Entity\Page\Container */ | |
use Concrete\Core\Area\ContainerArea; | |
?> | |
<div class="grid grid-cols-2 md:grid-cols-4 xl:grid-cols-5 gap-x-4 gap-y-8"> | |
<?php | |
$number = 1; | |
$area = new ContainerArea($container, 'Column ' . $number); | |
$area->display($c); | |
while ($number % 5 !== 0 || $area->getTotalBlocksInArea($c) > 0) { | |
$number++; | |
$area = new ContainerArea($container, 'Column ' . $number); | |
$area->display($c); | |
} | |
?> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment