Bagisto Forum

    Bagisto

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups

    New extension have 2 active menu items in the admin panel

    General Discussion
    2
    2
    492
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • R
      rabol last edited by

      Hello,

      I have created a new extension that have 2 menu items, but when 2nd menu is selected both items get the 'active' class in the html tags

      This is my admin-menu.php

      <?php
      
      return [
          [
              'key' => 'simple-product-import',
              'name' => 'SimpleProductImport',
              'route' => 'admin.simple-product-import.index',
              'sort' => 99, // to get as the last
              'icon-class' => 'simple-product-import-icon',
          ],
          [
              'key' => 'simple-product-import.index',
              'name' => 'Import',
              'route' => 'admin.simple-product-import.index',
              'sort' => 1,
              'icon-class' => '',
          ],
          [
              'key' => 'simple-product-import.sample',
              'name' => 'Sample files',
              'route' => 'admin.simple-product-import.sample-file',
              'sort' => 2,
              'icon-class' => '',
          ]
      ];
      

      the generated HTML

      <li class="menu-item active">
        <a class="menubar-anchor"  href="https://bagisto.test/admin/simple-product-import">
          <span class="icon-menu icon simple-product-import-icon"></span>
          <span class="menu-label">SimpleProductImport</span>
          <span  class="icon arrow-icon rotate-arrow-icon arrow-icon-left"></span>
        </a>
        <ul class="sub-menubar">
          <li class="sub-menu-item active">
             <a href="https://bagisto.test/admin/simple-product-import">
             <span class="menu-label">Import</span>
             </a>
          </li>
          <li class="sub-menu-item active">
            <a href="https://bagisto.test/admin/simple-product-import/sample-file">
              <span class="menu-label">Sample files</span>
            </a>
          </li>
        </ul>
      </li>
      

      As you can see, two <li> have 'sub-menu active'

      Any hints why ?

      1 Reply Last reply Reply Quote 0
      • sanjay-webkul
        sanjay-webkul last edited by

        Hi there,
        Is it posible to share the screen recording for the same , it will help me to reproduce the issue.

        1 Reply Last reply Reply Quote 0
        • First post
          Last post