Name: drupal-phplayout
Owner: Makina Corpus
Description: PHP Layout library support, brings page composition capacity to Drupal
Created: 2017-03-19 16:30:02.0
Updated: 2017-03-19 16:30:43.0
Pushed: 2017-12-27 16:08:21.0
Homepage: null
Size: 235
Language: PHP
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
This module uses the makinacorpus/php-layout library to provide a powerful layout builder atop of Drupal nodes.
For this to work, your Drupal installation needs to be composer based:
oser require makinacorpus/drupal-phplayout
h -y en phplayout
Default configuration will automatically provide a single layout for each node
in the content
region, for further configuration, you may want to
implement a Symfony event plugged on the
MakinaCorpus\Layout\EventDispatcher\CollectLayoutEvent::EVENT_NAME
event in order to change the layout discovery and loading business logic.
Per default, this module renders layouts using a Twitter Bootstrap 3 compatible HTML layout for which you may want to configure a few behaviours.
First, you have to understand that each layout is based upon a region. In order to configure their behaviours you will configure it on a per region basis, providing an array of option per region. Those array keys are detailed in the following chapters.
Per default the layouts grids will be surrounded by a Bootstrap container div, but if your page template already contain a container, this is lead to invalid Bootstrap grid system usage (indeed, containers should not be nested). To disable the container on a per region basis, set this option:
f['phplayout_region_options'] = [
'my_region' => [
// ... other options
'container-none': true
],
On the other hand, if you wish to keep the container div but wishes to make it fluid, set this options:
f['phplayout_region_options'] = [
'my_region' => [
// ... other options
'container-fluid': true
],
Please note that usage of the container-none
option will superseed this one.
Just for the sake of example, here is a complete example:
f['phplayout_region_options'] = [
'default' => [
'container-drop': true
],
'content' => [
'container-fluid': true
],
'header' => [
'container-fluid': false
],
'footer' => [
'container-fluid': false
],
'sidebar_left' => [
'container-none': true
],
The default
key is not a region name, but default options applied if none
are providen for a specific region.
This is sadly not supported yet but will be very soon.
@todo make bare grid html overridable