Allow MenuSection to be an external link #3977
Replies: 5 comments 2 replies
-
I ended up using this ugly workaround where I replace the menu-item with an imposter which is just a regular link.
|
Beta Was this translation helpful? Give feedback.
-
I have the same issue here, I am still wondering why they didn't add an external link on Menu Section, this work-around does not work as I was expecting, there for, I'm going to do the same thing as @sanderbaas I didn't find better way to do it.
|
Beta Was this translation helpful? Give feedback.
-
I would like to do the same as i have 2 external tools with major functionality and they feel like a 2nd class citizen when they cant be added bold, larger and with an icon in the sidebar |
Beta Was this translation helpful? Give feedback.
-
Yeah this is an annoying oversight in the menu tools... I can't see any reason why we shouldn't be able to add ->externalLink to a MenuSection. |
Beta Was this translation helpful? Give feedback.
-
I'm facing the same issue and found a CSS only workaround based on this StackOverflow answer:
public function boot()
{
parent::boot();
Nova::style('custom-nova', public_path('css/custom-nova.css'));
Nova::mainMenu(function (Request $request) {
return [
Menu\MenuItem::externalLink('Back to app', route('app')),
// ...
];
});
}
.sidebar-menu > div:first-child > a > span:first-child::before {
content: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='rgb(100, 116, 139)' width='24' height='24'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M10 19l-7-7m0 0l7-7m-7 7h18'%3E%3C/path%3E%3C/svg%3E");
}
.sidebar-menu > div:first-child > a span {
font-size: 16px;
} Please Nova team, allow external links on MenuSection to prevent us from adding complexity into our apps. |
Beta Was this translation helpful? Give feedback.
-
In Nova 3 I used tools to display items on the menu with icons these were external links to their relevant dashboards.
In Nova 4 we can easily add tools using the
menu()
method on ourTool
classes however, to replicate the above behaviour of displaying it as an a external link at the moment the onlyMenu
class that supports external links isMenuItem
but you cannotApp\Nova\Tools\InboxTool.php
Displays in the menu like this
Proposed
Allow
MenuSection
to be an externalLink:Which would display like this and open in a new tab when clicked
Workaround
This works in displaying correctly but instead of opening a new tab it opens the url in an overlay over the portal which is cool but would much prefer opening in a new tab!
Beta Was this translation helpful? Give feedback.
All reactions