Ticket #11727: contrib.flatpages.views.py.diff

File contrib.flatpages.views.py.diff, 970 bytes (added by chronos, 6 years ago)

FlatPages patch to support breadcrumbs.

  • contrib/flatpages/views.py

    diff -urN django-original/contrib/flatpages/views.py django/contrib/flatpages/views.py
    old new  
    55from django.conf import settings
    66from django.core.xheaders import populate_xheaders
    77from django.utils.safestring import mark_safe
     8from django.contrib.breadcrumbs.utils import breadcrumbs_for_flatpages
    89
    910DEFAULT_TEMPLATE = 'flatpages/default.html'
    1011
     
    2930    if f.registration_required and not request.user.is_authenticated():
    3031        from django.contrib.auth.views import redirect_to_login
    3132        return redirect_to_login(request.path)
     33    # if user enabled contrib.breadcrumbs add page to breadcrumbs
     34    if settings.BREADCRUMBS:
     35        breadcrumbs_for_flatpages(request,f)
    3236    if f.template_name:
    3337        t = loader.select_template((f.template_name, DEFAULT_TEMPLATE))
    3438    else:
Back to Top