Przeglądaj źródła

Additional body blocks (#40)

* Adding additional body blocks in base.html. Removing old unused reference in base.html

* Update web_page.html
Vince Salvino 6 lat temu
rodzic
commit
5ace6a6473

+ 9 - 1
coderedcms/templates/coderedcms/pages/base.html

@@ -100,9 +100,17 @@
 
         {% block navbar %}{% endblock %}
 
-        <div id="content" {% if page.page_content_width %}class="col-md-{{page.page_content_width}}"{% endif %}>
+        <div id="content">
             {% block content %}
+
+                {% block content_pre_body %}{% endblock %}
+
+                {% block content_body %}
                 {% include_block page.body with settings=settings %}
+                {% endblock %}
+
+                {% block content_post_body %}{% endblock %}
+
             {% endblock %}
 
             {% block index_content %}

+ 13 - 26
coderedcms/templates/coderedcms/pages/web_page.html

@@ -1,32 +1,19 @@
 {% extends "coderedcms/pages/web_page_notitle.html" %}
 {% load wagtailcore_tags wagtailimages_tags %}
 
-{% block content %}
-  {% 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>
-    {% else %}
-      <div class="container my-5">
+{% block content_pre_body %}
+  {% 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>
-    {% endif %}
-  {% endblock %}
-
-  {% block pre_content_body %}
-  {% endblock %}
-
-  {% block content_body %}
-    {% include_block page.body with settings=settings %}
-  {% endblock %}
-
-  {% block post_content_body %}
-  {% endblock %}
-
+    </div>
+  </div>
+  {% else %}
+  <div class="container my-5">
+    <h1>{{page.title}}</h1>
+  </div>
+  {% endif %}
 {% endblock %}