public function GridStackBase::build in GridStack 8.2
Alters GridStack build.
Parameters
array $build: An associative array containing:
- items: An array of gridstack contents: text, image or media.
- options: An array of key:value pairs of custom JS options.
- optionset: The cached optionset object to avoid multiple invocations.
- settings: An array of key:value pairs of HTML/layout related settings.
array $element: The render element being modified.
Overrides GridStackEnginePluginBase::build
File
- src/
Plugin/ gridstack/ engine/ GridStackBase.php, line 36
Class
- GridStackBase
- Provides the base class for two-dimensional layout engines.
Namespace
Drupal\gridstack\Plugin\gridstack\engineCode
public function build(array &$build, array &$element) {
parent::build($build, $element);
// Provides dummy item to fix layout aspect ratio.
if ($this
->getSetting('_gridstack')) {
$build['postscript']['dummy'] = $this
->buildDummyItem();
}
}