Use the following yaml configuration to override defaults;
WeDevelop\ElementalGrid\ElementalConfig:
default_viewport: 'MD'
use_custom_title_classes: true
css_framework: 'bulma'
default_title_tag: 'h2'
To use the Grid extension on the page you want in your project, copy the following code and paste it to your extensions.yml
Page\That\Uses\Grid:
extensions:
- DNADesign\Elemental\Extensions\ElementalPageExtension
If you want to have the possibility to switch between a normal Content field or the ElementalArea, place the following extension on the page that also uses the grid:
Page\That\Uses\Grid:
extensions:
- WeDevelop\ElementalGrid\Extensions\ElementalPageExtension
In your template, you can then use the following check to display the right content:
<% if $UseElementalGrid && $ElementalArea %>
$ElementalArea
<% else %>
$Content
<% end_if %>
Currently Bulma and Bootstrap (5) are the supported CSS frameworks that can be combined with this module.
To show the TitleTag in the template, use $TitleTag
. To show the TitleClass (which has to be enabled via the use_custom_title_classes
property in the yml config), use the variable $TitleSizeClass
in your .SS-template.
There are 3 extension point you can use to update which row, section and container CSS classes will be rendered in the templates.
In your own project, extend the ElementRow that lives in this module
WeDevelop\ElementalGrid\Models\ElementRow:
extensions:
- Your\ElementRow\Extension
Add these methods to your own ElementRow extension
public function updateSectionClasses(&$classes)
{
array_push($classes, 'add-your-own-css-class')
}
public function updateRowClasses(&$classes)
{
array_push($classes, 'add-your-own-css-class')
}
public function updateContainerClasses(&$classes)
{
array_push($classes, 'add-your-own-css-class')
}
Copy the file templates/WeDevelop/ElementalGrid/Models/ElementRow.ss
to your own themes/
folder. For example to:
themes/default/WeDevelop/ElementalGrid/Models/ElementRow.ss
. You can then edit the template to make it fit your needs.