2016-08-04 13 views
-2

Ich habe zwei Dateien, base.html und homepage.html. Homepage erweitert Basis und fügt zu Block extra hinzu. Base sollte den Block extra in einer Spanne innerhalb des Körpers rendern, tut dies aber nicht.`render_block`, die nichts in sekizai rendern

base.html:

{% load sekizai_tags %} 

<!doctype html> 
<html> 
    <head> 
     <title>Title</title> 
    </head> 
    <body> 
     <span style="color: red;">{% render_block "extra" %}</span> 
     {% block 'content' %} 
     {% endblock %} 
    </body> 
</html> 

homepage.html:

{% extends 'base.html' %} 
{% load sekizai_tags %} 

{% block 'content' %} 
    <p>that's some sweet content ya got there lad</p> 
    {% addtoblock "extra" %}wow{% endaddtoblock %} 
{% endblock %} 

Und die Ausgabe:

Just the <p>, the <span> is empty.

Was wirklich einfache Sache bin ich dabei?

Antwort

0

Aha, mir fehlte ein Kontext-Präprozessor aus meinen Vorlagen.

'sekizai.context_processors.sekizai',