Giter Club home page Giter Club logo

Comments (13)

danharrin avatar danharrin commented on July 24, 2024 1

navigationParentItem already exists btw https://filamentphp.com/docs/3.x/panels/navigation#grouping-navigation-items-under-other-items

from filament.

danharrin avatar danharrin commented on July 24, 2024

All groups go after ungrouped items, we do not break up the ungrouped items with groups as it could result in weird behaviour where you expect part of the group to be in one place and another part to be in another

from filament.

peter-mw avatar peter-mw commented on July 24, 2024

Is there some way to archive this effect, or this this can be made behind a flag ?

Will you accept PR for something like this?

image

from filament.

danharrin avatar danharrin commented on July 24, 2024

No sorry, it would introduce too much complexity into the navigation logic.

from filament.

danharrin avatar danharrin commented on July 24, 2024

You can use navigation groups with blank labels to achieve a similar affect if you define the navigation() function yourself

from filament.

peter-mw avatar peter-mw commented on July 24, 2024

Will try, thanks for the suggestions

from filament.

peter-mw avatar peter-mw commented on July 24, 2024

hi @danharrin

Can we have something like protected static ?array $acceptNavigationGroups = ['Two']

Parameter in the main menu acceptNavigationGroups ?

It will look like this

class One extends Page
{
    protected static ?string $navigationIcon = 'heroicon-o-document-text';

    protected static string $view = 'filament.pages.one';

    protected static ?int $navigationSort = 1;

    protected static ?array $acceptNavigationGroups = ['Two'];

}


class Two extends Page
{
    protected static ?string $navigationIcon = 'heroicon-o-document-text';

    protected static string $view = 'filament.pages.two';

    protected static ?int $navigationSort = 2;

    protected static ?string $navigationGroup = 'Two';

}

What do you think ?

from filament.

peter-mw avatar peter-mw commented on July 24, 2024

Or even better, an option is to research recursive menus with the KNP Menu builder, https://github.com/KnpLabs/KnpMenu

It allows unlimited nested menus.

from filament.

danharrin avatar danharrin commented on July 24, 2024

There is no technical reasons in PHP to not support nested menus. It's all frontend design work that is nearly impossible to balance and account for all combinations

from filament.

peter-mw avatar peter-mw commented on July 24, 2024

@danharrin

How to have a menu item appear inside another menu?

To make menu Two appear inside menu One, is not possbible at the moment

We can have new navigationParent parameter to solve this issue.

For example:

protected static ?string $navigationParent = 'One';

The class would look like this:

class TwoOne extends Page
{
    protected static ?int $navigationSort = 2;
    protected static ?string $navigationParent = 'One';
}
class ThreeOne extends Page
{
    protected static ?int $navigationSort = 3;
    protected static ?string $navigationParent = 'One';
}

The problem is how to have a single menu item, then a dynamic menu inside the single menu, and then another single menu item.

Can you suggest solution ?

from filament.

danharrin avatar danharrin commented on July 24, 2024

I dont understand what that would do, sorry

from filament.

peter-mw avatar peter-mw commented on July 24, 2024

Hi, here is a picture of what im trying to make

image

Is this possible ?

from filament.

danharrin avatar danharrin commented on July 24, 2024

I suggest using clusters instead

from filament.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.