Menu with subitems didn't show up on Bootstrap5

Hello there!

I installed a vanilla Yii2 advanced template and then follow this guideline: Installation guide: Yii-2 advanced template with RBAC system | Wiki | Yii PHP Framework 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.

does it work with BS4 or BS3 (default for Yii2)?

Hi Stefano,

thanks for your answer.

does it work with BS4 or BS3 (default for Yii2)?

I hope it so. BTW, how I achieve a regression to BS4? Yii2 template composer.json has:

    "require": {
        "php": ">=7.4.0",
        "yiisoft/yii2": "~2.0.45",
        "yiisoft/yii2-bootstrap5": "~2.0.2",
        "yiisoft/yii2-symfonymailer": "~2.0.3",
        "mdmsoft/yii2-admin": "~2.0"
    },

Thank you!

S.

I solved it changing the sources of the package yii2-admin; also post my proposal at: https://github.com/mdmsoft/yii2-admin/issues/474#issuecomment-1301944844