Skip to content

Menu with subitems didn't show up on Bootstrap5 #474

@numitec

Description

@numitec

Hello there,

I installed a vanilla Yii2 advanced template and then follow this guideline: https://www.yiiframework.com/wiki/848/installation-guide-yii-2-advanced-template-with-rbac-system to implement yii2-admin.

But when I try to show the menu, the options with sub items don't show at all: I can only click on the top item.

I instantiate the menu using:

use yii\bootstrap5\Breadcrumbs;
use yii\bootstrap5\Html;
use yii\bootstrap5\Nav;
use yii\bootstrap5\NavBar;

use mdm\admin\components\MenuHelper;

[...]

$menuItems = MenuHelper::getAssignedMenu(Yii::$app->user->id);

		echo Nav::widget([
			'options' => ['class' => 'navbar-nav ml-auto'], // navbar-right'],
			'items' => $menuItems,
			'encodeLabels' => False,
		]);

Any clue?

Thank you!

S.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions