Allow images to be optional
This commit is contained in:
parent
8aea60da35
commit
339ffde323
2 changed files with 4 additions and 2 deletions
|
@ -3,7 +3,9 @@
|
|||
{% load wagtailimages_tags %}
|
||||
|
||||
{% block content %}
|
||||
<img class="hero" src="{% image_url page.hero_image 'width-1200' %}" alt="">
|
||||
{% if page.hero_image %}
|
||||
<img class="hero" src="{% image_url page.hero_image 'width-1200' %}">
|
||||
{% endif %}
|
||||
|
||||
<section class="hero container">
|
||||
<div class="hero-body">
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
{% load wagtailimages_tags %}
|
||||
|
||||
{% block main %}
|
||||
<main style="background-image: url({% image_url page.image 'width-1200' %})">
|
||||
<main {% if page.image %}style="background-image: url({% image_url page.image 'width-1200' %})"{% endif %}>
|
||||
<h1>{{ page.heading }}</h1>
|
||||
|
||||
<input id="search-input" class="input" type="text" placeholder="Search">
|
||||
|
|
Loading…
Reference in a new issue