Closed terabytesoftw closed 2 years ago
Q | A |
---|---|
Is bugfix? | ✔️ |
New feature? | ❌ |
Breaks BC? | ❌ |
Thanks for this fast fix, but it is still not the way what I expect.
Here is the case I would like to use:
my Nav widget is:
Nav::widget()
->currentPath('/home')
->homeLink('/home')
->items([
[
'label' => 'Home',
'url' => '/home',
],
[
'label' => 'Item1',
'url' => '/item1',
],
])
->render()
I expect that the first element in items
is marked with active
class.
Thanks for this fast fix, but it is still not the way what I expect.
Here is the case I would like to use:
my Nav widget is:
Nav::widget() ->currentPath('/home') ->homeLink('/home') ->items([ [ 'label' => 'Home', 'url' => '/home', ], [ 'label' => 'Item1', 'url' => '/item1', ], ]) ->render()
I expect that the first element in
items
is marked withactive
class.
You can now mark the first menu item as active, like this at https://getbootstrap.com/docs/5.1/components/navbar/#supported-content
Nav::widget()
->currentPath('/home')
->items([
[
'label' => 'Home',
'url' => '/home',
],
[
'label' => 'Item1',
'url' => '/item1',
],
])
->render()
May be add option doNotMarkActive(string ...$link)
?
In some cases we don't need mark home link as active.
¿Se puede agregar la opción?
doNotMarkActive(string ...$link)
En algunos casos, no necesitamos marcar el enlace de inicio como activo.
¿Se puede agregar la opción?
doNotMarkActive(string ...$link)
En algunos casos, no necesitamos marcar el enlace de inicio como activo.
Nav::widget()
->currentPath('/home')
->items([
[
'label' => 'Home',
'url' => '/home',
'active' => false,
],
[
'label' => 'Item1',
'url' => '/item1',
],
])
->render()