Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

249
Views
Django CMS Placeholder Within Template Block Not Displaying

I am following this tutorial on building a basic blog using the Django CMS and am encountering a strange behavior. It all started when I discovered that the Content area was not being created in the Structure section of the CMS. While investigating it, I discovered the strange behavior.

Here it is.

base.html:

<!-- Main Content -->
<div class="container">
    <div class="row">
        <div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1">
            {% block content %}{% endblock %}
        </div>
    </div>
</div>
<hr>

content.html:

{% extends "base.html" %}
{% load cms_tags %}

{% block content %}
    {% placeholder content or%}
    {% endplaceholder %}
{% endblock content %}

This configuration above displays no Content block on the Structure page of the CMS. However, if I change the base.html snippet to the following, it works.

base.html:

<!-- Main Content -->
<div class="container">
    <div class="row">
        <div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1">
                {% placeholder content or%}
                {% endplaceholder %}
        </div>
    </div>
</div>
<hr>

Could someone tell me why this happens? What am I missing in how Django handles the template blocks? It appears to me that the two cases should be treated identically. Yet, the result is obviously different. The tutorial claims that I should be changing the content.html side. However, as illustrated above, that does not work.

Any elucidation is appreciated!

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

I was able to resolve this using the following modifications.

base.html:

<!-- Main Content -->
{% placeholder content or %}
<div class="container">
    <div class="row">
        <div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1">
            {% block content %}{% endblock %}
        </div>
    </div>
</div>
<hr>
{% endplaceholder %}  

content.html:

{% extends "base.html" %}
{% load cms_tags %}

{% block content %}
{% endblock content %}
over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!