diff --git a/wagtail/admin/views/generic/base.py b/wagtail/admin/views/generic/base.py index fadabf86e6..365e9338a1 100644 --- a/wagtail/admin/views/generic/base.py +++ b/wagtail/admin/views/generic/base.py @@ -22,6 +22,8 @@ class WagtailAdminTemplateMixin(TemplateResponseMixin, ContextMixin): page_title = "" page_subtitle = "" header_icon = "" + # Breadcrumbs are opt-in until we have a design that can be consistently applied + _show_breadcrumbs = False breadcrumbs_items = [{"url": reverse_lazy("wagtailadmin_home"), "label": _("Home")}] template_name = "wagtailadmin/generic/base.html" @@ -42,7 +44,9 @@ class WagtailAdminTemplateMixin(TemplateResponseMixin, ContextMixin): context["page_title"] = self.get_page_title() context["page_subtitle"] = self.get_page_subtitle() context["header_icon"] = self.get_header_icon() - context["breadcrumbs_items"] = self.get_breadcrumbs_items() + context["breadcrumbs_items"] = None + if self._show_breadcrumbs: + context["breadcrumbs_items"] = self.get_breadcrumbs_items() return context def get_template_names(self): diff --git a/wagtail/admin/viewsets/model.py b/wagtail/admin/viewsets/model.py index a1bb6afc8e..1d5ced483c 100644 --- a/wagtail/admin/viewsets/model.py +++ b/wagtail/admin/viewsets/model.py @@ -52,6 +52,9 @@ class ModelViewSet(ViewSet): #: The view class to use for the inspect view; must be a subclass of ``wagtail.admin.views.generic.InspectView``. inspect_view_class = generic.InspectView + # Breadcrumbs can be turned off until we have a design that can be consistently applied + _show_breadcrumbs = True + #: The prefix of template names to look for when rendering the admin views. template_prefix = "" @@ -119,6 +122,7 @@ class ModelViewSet(ViewSet): "edit_url_name": self.get_url_name("edit"), "delete_url_name": self.get_url_name("delete"), "header_icon": self.icon, + "_show_breadcrumbs": self._show_breadcrumbs, **kwargs, } ) diff --git a/wagtail/locales/views.py b/wagtail/locales/views.py index 9d6e455931..43ec51cb75 100644 --- a/wagtail/locales/views.py +++ b/wagtail/locales/views.py @@ -98,6 +98,7 @@ class LocaleViewSet(ModelViewSet): model = Locale permission_policy = locale_permission_policy add_to_reference_index = False + _show_breadcrumbs = False index_view_class = IndexView add_view_class = CreateView diff --git a/wagtail/sites/views.py b/wagtail/sites/views.py index 6b48612496..5112585cb6 100644 --- a/wagtail/sites/views.py +++ b/wagtail/sites/views.py @@ -52,6 +52,7 @@ class SiteViewSet(ModelViewSet): model = Site permission_policy = site_permission_policy add_to_reference_index = False + _show_breadcrumbs = False index_view_class = IndexView add_view_class = CreateView diff --git a/wagtail/snippets/views/snippets.py b/wagtail/snippets/views/snippets.py index 8ece57a455..e8d1cf5d4e 100644 --- a/wagtail/snippets/views/snippets.py +++ b/wagtail/snippets/views/snippets.py @@ -79,6 +79,7 @@ class ModelIndexView(generic.IndexView): header_icon = "snippet" index_url_name = "wagtailsnippets:index" default_ordering = "name" + _show_breadcrumbs = True def setup(self, request, *args, **kwargs): super().setup(request, *args, **kwargs) diff --git a/wagtail/users/views/groups.py b/wagtail/users/views/groups.py index 44eb48e532..dfe6a49ca7 100644 --- a/wagtail/users/views/groups.py +++ b/wagtail/users/views/groups.py @@ -158,6 +158,7 @@ class GroupViewSet(ModelViewSet): icon = "group" model = Group add_to_reference_index = False + _show_breadcrumbs = False index_view_class = IndexView add_view_class = CreateView