You are here

public function MenuLinkTreeHandler::getMenuLinkItemViewMode in Menu Item Extras 8.2

Get Menu Link Item view mdoe.

Parameters

\Drupal\Core\Menu\MenuLinkInterface $link: Original link entity.

Return value

string View mode property.

Overrides MenuLinkTreeHandlerInterface::getMenuLinkItemViewMode

File

src/Service/MenuLinkTreeHandler.php, line 110

Class

MenuLinkTreeHandler
Class MenuLinkTreeHandler.

Namespace

Drupal\menu_item_extras\Service

Code

public function getMenuLinkItemViewMode(MenuLinkInterface $link) {
  $entity = $this
    ->getMenuLinkItemEntity($link);
  if ($entity) {
    return $this
      ->getMenuLinkContentViewMode($entity);
  }
  return 'default';
}