Open Closed

Menu Items Not Active Behavior #8999


User avatar
0
Baytech created

How can I make the Courses > Edit menu item stay active for when it routes to courses/edit/{id}. The menu item is active on courses/edit but when I route to courses/edit/{id}, it no longer stays active. I attached two images below showing this behavior.
image.png
image.png


2 Answer(s)
  • User Avatar
    0
    berkansasmaz created
    Support Team .NET Developer

    Hello,

    YourComponentName-routing.module.ts should be as follows:

    import { CreateBookComponent } from './create-book/create-book.component';
    import { EditBookComponent } from './edit-book/edit-book.component';
    
    const routes: Routes = [
      { path: '', component: BookComponent, canActivate: [authGuard, permissionGuard] },
      { path: 'create', component: CreateBookComponent },
      { path: 'edit/:id', component: EditBookComponent },
    ];
    

    More information on this topic can be found here: https://abp.io/community/articles/converting-createedit-modal-to-page-angularui-doadhgil

  • User Avatar
    0
    Baytech created

    The link you provided also highlights the same problem.
    Here the books menu item link is active and highlighted:
    image.png

    Once you route to /create, it is not longer highlighted:
    image.png

    The book menu item matches the path "/books" so the menu item is active, but when you route to "books/create" it no longer is a match and removes the active class from the menu item.

Boost Your Development
ABP Live Training
Packages
See Trainings
Mastering ABP Framework Book
Do you need assistance from an ABP expert?
Schedule a Meeting
Mastering ABP Framework Book
The Official Guide
Mastering
ABP Framework
Learn More
Mastering ABP Framework Book
Made with ❤️ on ABP v9.2.0-preview. Updated on March 20, 2025, 18:00