Is {ifCurrent} going to be removed?
- netteman
- Member | 125
Hi,
I'm using the {ifCurrent} macro in my templates because it's super easy to use.
But it's marked as deprecated :(
https://latte.nette.org/cs/tags#…
https://latte.nette.org/en/tags#…
Could you tell me if it's going to be removed in the upcomming Nette 3.0 (and I'll have to switch to the really-difficult-to-write $presenter->isLinkCurrent($link) ? …)
Thanks :)
- David Grudl
- Nette Core | 8201
Because $presenter->isLinkCurrent($link)
is more
universal:
<li n:class="$presenter->isLinkCurrent('Product:show') && $otherCondition ? active : in-active">
<a n:href="Product:show">...</a>
</li>
When it is used inside element A, it is not necessary to repeat link destination:
<a n:class="$presenter->isLinkCurrent() ? active : normal" n:href="Product:show">...</a>
Latte 2.6 comes with custom functions, so it will be even easier:
<a n:class="isLinkCurrent() ? active : normal" n:href="Product:show">...</a>