File tree 1 file changed +6
-5
lines changed
fragdenstaat_de/fds_cms/templatetags
1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change 1
1
from django import template
2
2
from django .conf import settings
3
3
4
- from cms .models import StaticPlaceholder , Page
4
+ from cms .models import Page , StaticPlaceholder
5
5
6
6
from ..responsive_images import (
7
7
ResponsiveImage ,
@@ -78,17 +78,18 @@ def get_soft_root(page):
78
78
return soft_root
79
79
return page .get_root ()
80
80
81
+
81
82
@register .simple_tag (takes_context = True )
82
83
def get_breadcrumb_ancestor (context , navigation_node ):
83
84
print (context )
84
85
if navigation_node == None :
85
86
return
86
-
87
+
87
88
try :
88
89
request = context ["request" ]
89
90
except KeyError :
90
91
return
91
-
92
+
92
93
page = Page .objects .get (pk = navigation_node .id )
93
94
94
95
try :
@@ -99,12 +100,12 @@ def get_breadcrumb_ancestor(context, navigation_node):
99
100
100
101
if ancestor == None :
101
102
return
102
-
103
+
103
104
if only_upwards and request .current_page != page :
104
105
return
105
106
106
107
title = ancestor .get_title (language = request .LANGUAGE_CODE )
107
108
url = ancestor .get_absolute_url (language = request .LANGUAGE_CODE )
108
109
icon = ancestor .fdspageextension .icon
109
110
110
- return {"title" : title , "url" : url , "icon" : icon }
111
+ return {"title" : title , "url" : url , "icon" : icon }
You can’t perform that action at this time.
0 commit comments