Laravel-adminlte: How to create new data attributes in menu item?

Created on 1 Apr 2020  路  7Comments  路  Source: jeroennoten/Laravel-AdminLTE

Creating a new data-attribute in menu item to use in my controls.

Example:

['header' => 'account_settings'],
[
'text' => 'profile',
'url' => 'admin/settings',
'icon' => 'fas fa-fw fa-user',
'my-data' => 'new-data-attribute'
],

question scheduled

Most helpful comment

@lacodimizer sure :D assign me on it, I'll create a PR for it and may other issues too.

All 7 comments

There is actually no way to add custom data attributes.

I am altering the menu-item.blade.php file to this.
But, the better would be on config file of adminlte.

There is actually no way to add custom data attributes.

I don't understand, no possible to add input or change menu ? Thank you

@REJack we can add this as a new feature to the menu 馃憤

@lacodimizer sure :D assign me on it, I'll create a PR for it and may other issues too.

@lacodimizer I wait until #558 is merged and then I implement my prebuild code 馃槃.

I build a Menu Filter called DataFilter and it generate from this code

[
    'text'        => 'pages',
    'url'         => 'admin/pages',
    'icon'        => 'far fa-fw fa-file',
    'label'       => 4,
    'label_color' => 'success',
    'data'        => [
        'test' => 'tesa',
        'fest' => 'fesa',
    ],
],

this data tags 馃槃

data-test="tesa" data-fest="fesa"

@REJack done. :D

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Shidersz picture Shidersz  路  5Comments

WillieOng-HK picture WillieOng-HK  路  4Comments

rafayet-monon picture rafayet-monon  路  3Comments

sebian29 picture sebian29  路  4Comments

vissini picture vissini  路  6Comments