Unregister cluster in navigation menu

Hi, I'm trying to hide the cluster in the navigation menu using protected static bool $shouldRegisterNavigation = false; , but it's not working. I want to hide it because it's for account settings, which I prefer to show under the profile dropdown instead of the regular navigation menu. How can I achieve this?
Solution:
try like this
Jump to solution
9 Replies
dissto
dissto4mo ago
Can you not use canAccess ? In your cluster class.
public static function canAccess(): bool
{
return false; // your condition
}
public static function canAccess(): bool
{
return false; // your condition
}
Dennis Koch
Dennis Koch4mo ago
That means people can’t access it at all.
dissto
dissto4mo ago
Yes but that also means its not registered and therefor not in the sidebar 🤓 Why not remove the cluster from the account settings and properly register a new user menu item instead? 🤔
Stephan
StephanOP4mo ago
Because I want to use sub navigation for it.. Thats not possible then is it? I have 3 pages: ProfileSettings, ChangePassword and MySubscription
Vp
Vp4mo ago
in which file you put this?
Stephan
StephanOP4mo ago
In the general Cluster file..:
class AccountSettings extends Cluster
{
protected static bool $shouldRegisterNavigation = false;
...
}
class AccountSettings extends Cluster
{
protected static bool $shouldRegisterNavigation = false;
...
}
Solution
Vp
Vp4mo ago
try like this
Stephan
StephanOP4mo ago
Oh wow, that worked
class AccountSettings extends Cluster
{
protected static ?string $navigationIcon = 'heroicon-o-cog-6-tooth';

public static function shouldRegisterNavigation(): bool
{
return false;
}
}
class AccountSettings extends Cluster
{
protected static ?string $navigationIcon = 'heroicon-o-cog-6-tooth';

public static function shouldRegisterNavigation(): bool
{
return false;
}
}
Thanks, @Vp !
Want results from more Discord servers?
Add your server