Only try to render resolved links
This commit is contained in:
@@ -24,6 +24,7 @@ def button_navigation_widget(request, link):
|
||||
def render_widget(request, link):
|
||||
context = RequestContext(request)
|
||||
resolved_link = link.resolve(context)
|
||||
if resolved_link:
|
||||
return mark_safe(u'<a style="text-decoration:none; margin-right: 10px;" href="%(url)s"><button style="vertical-align: top; padding: 1px; width: 110px; height: 100px; margin: 10px;"><img src="%(static_url)simages/icons/%(icon)s" alt="%(image_alt)s" /><p style="margin: 0px 0px 0px 0px;">%(string)s</p></button></a>' % {
|
||||
'url': resolved_link.url,
|
||||
'icon': getattr(resolved_link, 'icon', 'link_button.png'),
|
||||
@@ -31,3 +32,5 @@ def render_widget(request, link):
|
||||
'string': capfirst(resolved_link.text),
|
||||
'image_alt': _(u'icon'),
|
||||
})
|
||||
else:
|
||||
return u''
|
||||
|
||||
Reference in New Issue
Block a user