diff --git a/pages/templates/pages/breadcrumbs.html b/pages/templates/pages/breadcrumbs.html index bc336e5..57289e4 100644 --- a/pages/templates/pages/breadcrumbs.html +++ b/pages/templates/pages/breadcrumbs.html @@ -13,15 +13,17 @@ {% endif %} {% if show_siblings and logic_page.siblings %} -
+ {% if show_last_page_siblings or not forloop.last %} + + {% endif %} {% endif %} diff --git a/pages/templatetags/pages_extras.py b/pages/templatetags/pages_extras.py index a545e60..c043072 100644 --- a/pages/templatetags/pages_extras.py +++ b/pages/templatetags/pages_extras.py @@ -8,7 +8,7 @@ register = template.Library() -def _base_breadcrumbs(page: Page, separator='', *, show_siblings=False): +def _base_breadcrumbs(page: Page, separator='', *, show_siblings=False, show_last_page_siblings=False): return { 'breadcrumbs': [ # @todo #345:60m Refold catalog pages in DB. @@ -21,17 +21,18 @@ def _base_breadcrumbs(page: Page, separator='', *, show_siblings=False): ], 'separator': separator, 'show_siblings': show_siblings, + 'show_last_page_siblings': show_last_page_siblings, } @register.inclusion_tag('pages/breadcrumbs.html') def breadcrumbs(page: Page, separator=''): - return _base_breadcrumbs(page, separator, show_siblings=False) + return _base_breadcrumbs(page, separator, show_siblings=False, show_last_page_siblings=False) @register.inclusion_tag('pages/breadcrumbs.html') -def breadcrumbs_with_siblings(page: Page, separator=''): - return _base_breadcrumbs(page, separator, show_siblings=True) +def breadcrumbs_with_siblings(page: Page, separator='', show_last_page_siblings=True): + return _base_breadcrumbs(page, separator, show_siblings=True, show_last_page_siblings=show_last_page_siblings) @register.inclusion_tag('pages/accordion.html')