You are here

public function TBMegaMenuBuilder::addColContent in The Better Mega Menu 8

Same name and namespace in other branches
  1. 2.x src/TBMegaMenuBuilder.php \Drupal\tb_megamenu\TBMegaMenuBuilder::addColContent()

Add menu item content to a column.

Parameters

array $items: All items in the current menu.

array $item_config: The current configuration for all items.

Overrides TBMegaMenuBuilderInterface::addColContent

1 call to TBMegaMenuBuilder::addColContent()
TBMegaMenuBuilder::syncConfig in src/TBMegaMenuBuilder.php
Populate the item_config values.

File

src/TBMegaMenuBuilder.php, line 359

Class

TBMegaMenuBuilder
Defines a TBMegaMenuBuilder.

Namespace

Drupal\tb_megamenu

Code

public function addColContent(array $items, array &$item_config) {
  foreach ($items as $plugin_id => $item) {
    if ($item->link
      ->isEnabled()) {
      $item_config['rows_content'][0][0]['col_content'][] = [
        'type' => 'menu_item',
        'plugin_id' => $plugin_id,
        'tb_item_config' => [],
        'weight' => $item->link
          ->getWeight(),
      ];
    }
  }
}