fix: set sidebar only if not present

The get_context of some templates set their own sidebar
if this is done, no need to override
This commit is contained in:
18alantom 2023-11-29 12:04:18 +05:30
parent caf2c45ed0
commit 5722d9c2ba

View file

@ -109,7 +109,8 @@ class TemplatePage(BaseTemplatePage):
super().post_process_context()
def add_sidebar_and_breadcrumbs(self):
self.context.sidebar_items = get_sidebar_items(self.context.website_sidebar, self.basepath)
if not self.context.sidebar_items:
self.context.sidebar_items = get_sidebar_items(self.context.website_sidebar, self.basepath)
if self.context.add_breadcrumbs and not self.context.parents:
parent_path = os.path.dirname(self.path)