Open fsbraun opened 4 months ago
Also, when using the template system it would be very helpful to have the ability to contextually show different markup regarding the static_alias, as with static_placeholders in v3, e.g:
{% if static_alias_name == 'Static Alias 1' %}
<div class="static_alias_1_wrap"></div>
{% elif static_alias_name == 'Static Alias 2' %}
<div class="static_alias_2_wrap"></div>
{% else %}
<div class="static_alias_default_wrap"></div>
{% endif %}
Hey @evill33t actually I did exactly the same to achieve the wanted behaviour but dealing with clients is the main cause I asked for the "old fashion" behaviour since they usually expect something to be added and just work OOTB (without selecting the actual template).
Thanks for the heads-up though.
I deleted my comment, I was wrong about the template - imho it should be able to choose different slots which would solve this issue.
There's a basic design problem here:
render_alias
tag within them calls the same common alias template, again.)My best assessment is that one could:
static_code
or "content" if static_code
is unset. (This is a breaking change, however, since the placeholder names of existing aliases changes, partly mitigable by a custom migration)
This issue has been raised by Tow Cowan on Slack and @petrklus:
I used static_placeholder to allow site-wide content to be edited, and could control the plugins used in this with the
CMS_PLACEHOLDER_CONF
setting. I’m now using v4 for a new project - am I able to do something similar with thestatic_alias
tag? I don’t seem to be able to do so with the configuration I’ve tried. For example, if I have the following in my base.html template (outside of any blocks):And then the following in my settings:
When I view the Alias (Django Admin -> Django CMS Alias -> Aliases -> Preview) and then try to add a plugin, it ignores the above placeholder config. If I add a key for a “content” placeholder in
CMS_PLACEHOLDER_CONF
it does allow me to configure the available plugins, but this would mean that all of my static_alias tags would have the same configuration.