Answer the question
In order to leave comments, you need to log in
How to display EXTRA_MODEL_FIELDS in Mezzanin template?
It is not possible to display the field added via EXTRA_MODEL_FIELDS in the template.
In /mezzanine/site/site/settings.py at the end of the file added:
EXTRA_MODEL_FIELDS = (
# Four-item sequence for one field injected.
(
# Dotted path to field.
"mezzanine.pages.models.RichTextPage.header_image",
# Dotted path to field class.
"django.db.models.ImageField",
# Positional args for field class.
("Изображение в шапке",),
# Keyword args for field class.
{"blank": True, "upload_to": "top_images"},
),
)
{% if page.header_image %}{{ page.header_image }}{% else %}/static/img/home/slider/2.jpg{% endif %}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question