Templated Page - Sidebar #5802
-
Hello again, I am trying to create a new "app" (plugin with a navbar item and app page) using the plugin system. I want to make a new tab using Navigation Mixin (which I have been able to do), which brings you to a new page similar to /stock/# (a site with the navbar, sidebar, content, etc). I could implement this into an existing app (stock, part, etc) using panel mixins. However, I plan on implementing enough separate tabs to need a separate page. I looked into how "apps" (like parts and stock) implement this, and it appears pages extend I have posted relevant code below. I included "my own" sidebar items and attempted to copy the contents of a stock sidebar in an attempt to get anything to appear. I have tried making the sidebar its own file, only including the stock one, only have "my sidebar items" (I copied and pasted yours for testing). I am currently unsure why the sidebar will not appear. Would you be able to tell if you see an obvious issue or if there may be a backend issue causing the sidebar not to appear? As always, I am grateful for any time and help you may be able to provide! My Attempt: {% extends "page_base.html" %}
{% load static %}
{% load inventree_extras %}
{% load plugin_extras %}
{% load i18n %}
{% block page_title %}
{% inventree_title %} | {% trans "Loaning" %} - {{ item }}
{% endblock page_title %}
{% block sidebar %}
{% trans "Sublocations" as text %}
{% include "sidebar_item.html" with label='sublocations' text=text icon="fa-sitemap" %}
{% trans "Stock Items" as text %}
{% include "sidebar_item.html" with label='stock' text=text icon="fa-boxes" %}
{% include "stock/location_sidebar.html" %}
{% endblock sidebar %} |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 9 replies
-
At the bottom of the page, you must enable the sidebar. I can't believe I missed this one, sorry about that {% block js_ready %}
{{ block.super }}
enableSidebar('stocklocation');
{% endblock js_ready %} |
Beta Was this translation helpful? Give feedback.
-
@CodingPupper3033 glad you worked it out! Do you think you could submit an update to the docs so that other users can see this too? |
Beta Was this translation helpful? Give feedback.
At the bottom of the page, you must enable the sidebar. I can't believe I missed this one, sorry about that