Answer the question
In order to leave comments, you need to log in
How to make menu items of Nested Set nested categories active?
On the website of an online store, a tree of product categories is built using the kalnoy/nestedset library .
Catalog menu displays only categories of the first level of nesting. Request in View Composers:
View::composer(['front.layouts.footer', 'front.layouts.menu_left'], function($view) {
$view->with(['menu' => Category::where()->select('name', 'slug')->orderBy('sort')->get()]);
});
Answer the question
In order to leave comments, you need to log in
Well, the nested set is just perfect for this task - you check that the current open category lies within the boundaries of the parent one, and that's it. It's not very clear what the problem is.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question