Skip to content

Allow MenuSection to be an external link #3976

@dmason30

Description

@dmason30

In Nova 3 I used tools to display items on the menu with icons these were external links to their relevant dashboards.

image

image

image

In Nova 4 we can easily add tools using the menu() method on our Tool classes however, to replicate the above behaviour of displaying it as an a external link at the moment the only Menu class that supports external links is MenuItem but you cannot

App\Nova\Tools\InboxTool.php

public function menu() {
    return MenuItem::externalLink('Horizon', route('horizon'))
}

Displays in the menu like this
image

Proposed
Allow MenuSection to be an externalLink:

public function menu() {
    return MenuSection::externalLink('Horizon', route('horizon'))
         ->icon('sun')
}

Which would display like this and open in a new tab when clicked
image

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!

public function menu(Request $request)
{
    return MenuSection::make('Horizon')
        ->path(URL::remote(route('horizon')))
        ->icon('sun');
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions