Closed bhrutledge closed 7 years ago
@bhrutledge we are most likely going to introduce a separate DJANGOCMS_STYLE_TEMPLATES
setting to support multiple templates. Though I do not understand your use case. You would still have to add the
Happy to see that this is already done! I'm imagining my template will be something like this (with the addition of other instance
attributes):
<section class="rec-section">
<h2>Recommended For You</h2>
<div class="rec-list">
{% for plugin in instance.child_plugin_instances %}{% render_plugin plugin %}{% endfor %}
</div>
</section>
IE, the link/image/text content will come from child plugins of the style.
@bhrutledge perfect, just so I understand the use case, that's what I'd have done. It will be integrated in the next release (around tomorrow). Just be aware that DJANGOCMS_STYLE_CHOICES
and DJANGOCMS_STYLE_TEMPLATES
are two separate settings.
I'm not sure this is the right place for this suggestion, or if it's already been done elsewhere, but here goes...
I think it would be handy to associate a Django template with entries in
DJANGOCMS_STYLE_CHOICES
, similar to how djangocms-link and -picture have optional templates.My immediate use case is a "Recommended for You" section, with markup that looks something like this:
Currently, to implement that, I think I my plugin structure would look something like this:
But, with a template that's mapped to
.rec-section
, and contains theh2
anddiv.rec-list
wrapper, the structure could be: