Answer the question
In order to leave comments, you need to log in
How to add active to product categories?
How to write a condition for adding the Active class to the category of goods to which we are moving?
So I tried it, the active class is not added to li:
In view
<ul class="category">
<li class="cat-item {{ Request::is('?cat={!!$category->id!!}') ? 'active' : '' }}">
<a class="widget-cat widget-link" href="?cat={{$category->id}}">{{$category->title}}</a>
</li>
</ul>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question