How can I remove items from the navigation menu in the admin UI? #2368
-
We are current not using the 'Collections' feature. Could you please guide me on how to remove the 'Collections' tab from the side navigation menu? I have reviewed the documentation and discovered a method to customise it, but unfortunately, it lacks specific details. Additionally, I stumbled upon a related issue, suggesting that this functionality has been implemented. However, it appears that there are no instructions in the documentation on how to remove it. I would greatly appreciate it if someone could provide guidance on achieving this. Even a simple code snippet would be immensely helpful. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hi, You are right, the current docs lack examples to illustrate. I'm currently upgrading all the docs but didn't get round to that part yet. Here's how it would work: import { NgModule } from '@angular/core';
import { SharedModule, addNavMenuItem} from '@vendure/admin-ui/core';
@NgModule({
imports: [SharedModule],
providers: [
addNavMenuItem({
id: 'collections', // <-- we will override the "collections" menu item
label: 'Collections',
routerLink: ['/catalog', 'collections'],
requiresPermission: '__disable__' // <- we use an invalid permission which ensures it is hidden from all users
},
'catalog'),
],
})
export class MyUiExtensionModule {} |
Beta Was this translation helpful? Give feedback.
Hi,
You are right, the current docs lack examples to illustrate. I'm currently upgrading all the docs but didn't get round to that part yet.
Here's how it would work: