Building the menu

The Sharp side menu can contain several links. Its organization is totally up to you, and is defined in the sharp.php config file.

Menu

All links shares common things:

Links can be grouped in categories, like Company, Travels and Admin in this example.

// sharp.php

[...]
"menu" => [
    [
        "label" => "Features",
        "icon" => "fa-superpowers",
        "entity" => "feature"
    ]
]

The entity value must correspond to some entity key described in the same sharp.php file.

// sharp.php

[...]
"menu" => [
    [
        "label" => "Account",
        "icon" => "fa-user",
        "entity" => "account",
        "single" => true
    ]
]

The single => true attribute would mean Sharp will create a link towards a SharpSingleShow implementation for the entity account. See [doc related to Shows](TODO link).

Very similar to entity lists, except that entity is replaced by a dashboard attribute which must contain a valid dashboard key:

// sharp.php

[...]
"menu" => [
    [
        "label" => "Dashboard",
        "icon" => "fa-dashboard",
        "dashboard" => "company_dashboard"
    ]
]
// sharp.php

[...]
"menu" => [
    [
        "label" => "Some external link",
        "icon" => "fa-globe",
        "url" => "https://google.com"
    ]
]

Categories are groups that can be collapsed

"menu" => [
    [
        "label" => "Company",
        "entities" => [
            [
                "label" => "Dashboard",
                "icon" => "fa-dashboard",
                "dashboard" => "company_dashboard"
            ],
            [
                "label" => "Spaceships",
                "icon" => "fa-space-shuttle",
                "entity" => "spaceship"
            ],
            [...]
        ]
    ]
]

Add separators in categories

You can add a simple labelled separator in categories, as sub-categories

"menu" => [
    [
        "label" => "Company",
        "entities" => [
            [
                "label" => "Dashboard",
                "icon" => "fa-dashboard",
                "dashboard" => "company_dashboard"
            ],
            [
                "separator" => true,
                "label" => "Separator",
            ],
            [
                "label" => "Spaceships",
                "icon" => "fa-space-shuttle",
                "entity" => "spaceship"
            ],
            [...]
        ]
    ]
]
Last Updated:
Contributors: antoine