Admin Panel - how is Admin side navigation state is maintained?

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
6 years ago
Hi,

Could anyone please explain how the side navigation works? I am trying to understand how the state of sidebar is collapsed and doesn't change even when different pages are accessed.

I tried to use local storage to maintain the state and using jquery set sidebar to collapsed or expanded. But its not how admin panel sidebar is setup.

Thanks,
Riyaz.
6 years ago
riyaz.chaudhari wrote:
Hi,

Could anyone please explain how the side navigation works? I am trying to understand how the state of sidebar is collapsed and doesn't change even when different pages are accessed.

Hi Riyaz,

It's as simple as we're doing in normal MVC application, to maintain state of sidebar generally we append "active" class to li or div. In a same way, nopCommerce handled with extension method(LayoutExtensions).
To see how it works, please refer: Nop.Web > administration > Views >Shared > Menu.cshtml

It's appending active class: <li @(isActive ? Html.Raw("class=\"active current-active-item\"") : null)>
riyaz.chaudhari wrote:

I tried to use local storage to maintain the state and using jquery set sidebar to collapsed or expanded. But its not how admin panel sidebar is setup.


Are you trying to do in your MVC application not in nopCommerce?
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.