Hi all,
I’m using a custom theme for my website, and when I go to Add Layout to an area, I’m only seeing the Free-Form Grid in the dropdown options.
Worth noting is that I’m using a modified BS5.3 file in my templates that’s been renamed:
<link rel="stylesheet" href="<?= $view->getThemePath() ?>/css/deniger.css">
So, what I did was create a page_theme.php file, and a grid_framework_presets file, both in my theme’s folder.
Here’s the page_theme.php file:
<?php
namespace Application\Theme\Portfolio2024;
use Concrete\Core\Page\Theme\Theme;
class PageTheme extends Theme
{
protected $pThemeGridFrameworkHandle = 'bootstrap5';
public function registerAssets()
{
// Register Bootstrap 5.3
$this->requireAsset('javascript', 'bootstrap5');
$this->requireAsset('css', 'bootstrap5');
$this->requireAsset('css', 'deniger');
}
public function getThemeName()
{
return t('2024');
}
public function getThemeDescription()
{
return t('Philippe Deniger // Creative Director');
}
}
And here’s the grid_framework_presets.php file:
<?php
return [
'grid_framework_presets' => [
'bootstrap5' => [
'name' => 'Bootstrap 5.3',
'container' => '<div class="container">',
'container-fluid' => '<div class="container-fluid">',
'row' => '<div class="row">',
'columns' => [
'<div class="col-sm-%s">' => 'grid-column-width-sm',
'<div class="col-md-%s">' => 'grid-column-width-md',
'<div class="col-lg-%s">' => 'grid-column-width-lg',
'<div class="col-xl-%s">' => 'grid-column-width-xl',
'<div class="col-xxl-%s">' => 'grid-column-width-xxl',
'<div class="offset-sm-%s">' => 'grid-column-offset-sm',
'<div class="offset-md-%s">' => 'grid-column-offset-md',
'<div class="offset-lg-%s">' => 'grid-column-offset-lg',
'<div class="offset-xl-%s">' => 'grid-column-offset-xl',
'<div class="offset-xxl-%s">' => 'grid-column-offset-xxl',
],
'columns_end' => '</div>',
'additional_classes' => '',
],
],
];
And with these files, I still don’t get the BS grid when I go to Add Layout, just the Free-Form Grid.
I’m not quite sure what I’m doing wrong, here.
So, how can I make sure I get the BS grid in my area layouts?
Many thanks!