Skip to content

Commit

Permalink
Update web_page.html
Browse files Browse the repository at this point in the history
Added additional blocks to ease template overwriting.
  • Loading branch information
Cory Sutyak authored Nov 30, 2018
1 parent a85ddcc commit 9b727b6
Showing 1 changed file with 22 additions and 13 deletions.
35 changes: 22 additions & 13 deletions coderedcms/templates/coderedcms/pages/web_page.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,31 @@
{% load wagtailcore_tags wagtailimages_tags %}

{% block content %}

{% if self.cover_image %}
{% image page.cover_image fill-2000x1000 as cover_image %}
<div class="hero-bg mb-5" style="background-image:url({{cover_image.url}});">
<div class="hero-fg">
<div class="container">
<h1>{{page.title}}</h1>
{% block content_header %}
{% if self.cover_image %}
{% image page.cover_image fill-2000x1000 as cover_image %}
<div class="hero-bg mb-5" style="background-image:url({{cover_image.url}});">
<div class="hero-fg">
<div class="container">
<h1>{{page.title}}</h1>
</div>
</div>
</div>
</div>
{% else %}
<div class="container my-5">
<h1>{{page.title}}</h1>
</div>
{% endif %}
{% else %}
<div class="container my-5">
<h1>{{page.title}}</h1>
</div>
{% endif %}
{% endblock %}

{% block pre_content_body %}
{% endblock %}

{% block content_body %}
{% include_block page.body with settings=settings %}
{% endblock %}

{% block post_content_body %}
{% endblock %}

{% endblock %}

1 comment on commit 9b727b6

@vsalvino
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This commit did not go through PR. I would argue that these new blocks be added to web_page_notitle.html template instead since that is really the base version of web_page.html. These two templates should be pretty much consistent.

Please sign in to comment.