You are here

public function GridStackListBuilder::render in GridStack 8.2

Same name and namespace in other branches
  1. 8 modules/gridstack_ui/src/Controller/GridStackListBuilder.php \Drupal\gridstack_ui\Controller\GridStackListBuilder::render()

Builds the entity listing as renderable array for table.html.twig.

@todo Add a link to add a new item to the #empty text.

Overrides DraggableListBuilder::render

1 call to GridStackListBuilder::render()
GridStackVariantListBuilder::render in modules/gridstack_ui/src/Controller/GridStackVariantListBuilder.php
Builds the entity listing as renderable array for table.html.twig.
1 method overrides GridStackListBuilder::render()
GridStackVariantListBuilder::render in modules/gridstack_ui/src/Controller/GridStackVariantListBuilder.php
Builds the entity listing as renderable array for table.html.twig.

File

modules/gridstack_ui/src/Controller/GridStackListBuilder.php, line 170

Class

GridStackListBuilder
Provides a listing of GridStack optionsets.

Namespace

Drupal\gridstack_ui\Controller

Code

public function render() {
  $build['description'] = [
    '#markup' => '<p>' . $this
      ->t("Manage the GridStack optionsets. Optionsets are Config Entities. Use the Operations column to edit, clone and delete optionsets.<br><br>By default, four default optionsets are created: <code>Admin, Frontend, Bootstrap, Foundation</code>. GridStack supports both one-dimensional layouts like Bootstrap, Foundation, etc. (<a href=':ui'>enable here</a>), and two-dimensional layouts via GridStack JS or native browser CSS Grid Layout, and Masonry, Packery, Isotope via <a href=':outlayer'>Outlayer</a> module. To generate icons, edit and save optionsets.<br><strong>Important!</strong><br>Avoid overriding default or sample optionsets. Any customization will be lost at the next update. Use <code>Duplicate</code> button instead, unless a module declares direct usages. <br>Use <a href=':url'>config_update</a> module to revert to stored optionsets at <code>/admin/config/development/configuration/report/module/gridstack</code>, if needed. Clearing cache is required to register the new layouts for Layout Discovery/ Layout Builder.", [
      ':ui' => Url::fromRoute('gridstack.settings')
        ->toString(),
      ':url' => '//drupal.org/project/config_update',
      ':outlayer' => '//drupal.org/project/outlayer',
    ]) . '</p>',
  ];
  $build[] = parent::render();
  $attachments = $this->manager
    ->attach([
    'blazy' => TRUE,
  ]);
  $build['#attached'] = isset($build['#attached']) ? NestedArray::mergeDeep($build['#attached'], $attachments) : $attachments;
  $build['#attached']['library'][] = 'gridstack/admin';
  return $build;
}