zuramai / mazer

Free and Open-source Bootstrap 5 Admin Dashboard Template and Landing Page
http://zuramai.github.io/mazer
MIT License
2.71k stars 763 forks source link

How to create a dynamic menu #295

Closed Macfee closed 3 months ago

Macfee commented 3 months ago

Hello everyone, I would like to ask for some advice. This UI is great and is perfect for my front-end and back-end project. Now, I want to create a dynamic menu. Could you please advise me on how to set it up?

RomanBobkov commented 3 months ago

@Macfee hello! All what you need is manage <li class="sidebar-item"> <a href="/" class="sidebar-link"> <i class="bi bi-grid-fill"></i> <span>Menu item name</span> </a> </li> items. I see you use Django. Then you can render template using conditions. Like

{% if showSettings %}
<li class="sidebar-item">
      <a href="/settings" class="sidebar-link">
          <i class="bi bi-grid-fill"></i>
          <span>Settings</span>
      </a>
  </li>
{% endif %}

Hope it helps.

github-actions[bot] commented 3 months ago

This issue has been automatically marked as stale because it has been open for 14 days without activity. It will be closed if no further activity occurs within the next 14 days. If this is still an issue, just leave a comment or remove the "stale" label.

alfianchii commented 3 months ago

Thanks to @RomanBobkov. Hope it helps! @Macfee