Skip to content

Instantly share code, notes, and snippets.

@TohidN
Last active July 19, 2024 07:36
Show Gist options
  • Select an option

  • Save TohidN/e617167a55c5c20e4b08cf694e2125d5 to your computer and use it in GitHub Desktop.

Select an option

Save TohidN/e617167a55c5c20e4b08cf694e2125d5 to your computer and use it in GitHub Desktop.
Customize context for Wagtail page model
def get_context(self, request, *args, **kwargs):
context = super().get_context(request, *args, **kwargs)
# Add extra variables and return the updated context. E.g.
#context['blog_entries'] = BlogPage.objects.child_of(self).live()
return context
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment