File tree Expand file tree Collapse file tree 2 files changed +19
-17
lines changed
apps/banners/templatetags Expand file tree Collapse file tree 2 files changed +19
-17
lines changed Original file line number Diff line number Diff line change @@ -48,12 +48,14 @@ def get_banner(context, place):
4848
4949 if not banners :
5050 return ''
51- for banner in banners :
52-
53- response = loader .render_to_string ("blocks/banner.html" , {
54- 'image' : banner .file_img ,
55- 'place' : place ,
56- 'width' : banner .width ,
57- 'height' : banner .height ,
58- })
51+
52+ banner = banners .first ()
53+
54+ response = loader .render_to_string ("blocks/banner.html" , {
55+ 'image' : banner .file_img ,
56+ 'place' : place ,
57+ 'width' : banner .width ,
58+ 'height' : banner .height ,
59+ 'link_to' : banner .link_to ,
60+ })
5961 return response
Original file line number Diff line number Diff line change 11{% load staticfiles nginx_image %}
22
33< div id ="banner " style ="text-align: center; ">
4-
5- {% if image %}
6- < img src ="{% thumbnail image %} " width ="{{width}} " height ="{{height}} " alt ="">
7- {% endif %}
8-
9- {% if context %}
10- {{ context }}
11- {% endif %}
12-
4+ < a href =" {% if link_to %}{{ link_to }}{% endif %} " >
5+ {% if image %}
6+ < img src ="{% thumbnail image %} " width ="{{width}} " height ="{{height}} " alt ="">
7+ {% endif %}
8+
9+ {% if context %}
10+ {{ context }}
11+ {% endif %}
12+ </ a >
1313</ div >
You can’t perform that action at this time.
0 commit comments