diff --git a/config/settings.py b/config/settings.py index 6f9c2c5e..da71243d 100644 --- a/config/settings.py +++ b/config/settings.py @@ -101,6 +101,7 @@ "django.contrib.messages.context_processors.messages", "wagtail.contrib.settings.context_processors.settings", "wagtailmenus.context_processors.wagtailmenus", + "content_manager.context_processors.skiplinks", ], }, }, diff --git a/content_manager/context_processors.py b/content_manager/context_processors.py new file mode 100644 index 00000000..0ad809a0 --- /dev/null +++ b/content_manager/context_processors.py @@ -0,0 +1,7 @@ +def skiplinks(request): + return { + "skiplinks": [ + {"link": "#content", "label": "Contenu"}, + {"link": "#fr-navigation", "label": "Menu"}, + ] + } diff --git a/content_manager/models.py b/content_manager/models.py index e1cf6cae..6248457f 100644 --- a/content_manager/models.py +++ b/content_manager/models.py @@ -61,15 +61,6 @@ class ContentPage(Page): index.SearchField("body"), ] - def get_context(self, request, *args, **kwargs): - context = super().get_context(request, *args, **kwargs) - - context["skiplinks"] = [ - {"link": "#content", "label": "Contenu"}, - {"link": "#fr-navigation", "label": "Menu"}, - ] - return context - class MonospaceField(models.TextField): """