gridstack-8.x-2.5/templates/gridstack.html.twig
templates/gridstack.html.twig
{#
/**
* @file
* Default theme implementation for the GridStack template.
*
* Available variables:
* - items: The array of items containing gridstack contents and captions.
* - settings: A cherry-picked settings that mostly defines the box HTML or
* layout, and none of JS settings/options which are defined at data-config.
* - attributes: The array of attributes to hold classes, id and config data
* containing JSON object aka JS settings the GridStack expects. We don't
* store these JS settings in the normal <head>, but inline within
* data-config attribute instead.
*
* Debug:
* @see https://www.drupal.org/node/1906780
* @see https://www.drupal.org/node/1903374
* Use Kint: {{ kint(variable) }}
* Dump all available variables and their contents: {{ dump() }}
* Dump only the available variable keys: {{ dump(_context|keys) }}
*/
#}
{%
set classes = [
settings.class_by_id ? settings.class_by_id|clean_class,
settings.enabled ? 'gridstack--packing is-gs-enabled',
settings.noMargin ? 'gridstack--nomargin',
settings.skin ? 'gridstack--skin--' ~ settings.skin|clean_class,
settings.use_framework ? 'row' : 'gridstack--js',
settings.ungridstack ? 'ungridstack',
]
%}
{%
set nested_classes = [
settings.use_framework ? 'row' : 'gridstack gridstack--nested gridstack--js',
]
%}
{% spaceless %}
<{{ wrapper }}{{ attributes.addClass(settings.root ? classes : nested_classes) }}>
{{ items }}
{% block gridstack_postscript %}
{{ postscript }}
{% endblock %}
</{{ wrapper }}>
{% endspaceless %}
