aldryn / aldryn-segmentation

Other
8 stars 5 forks source link

Unable to re-order inactive segments #7

Open petrklus opened 8 years ago

petrklus commented 8 years ago

In a nutshell, if a segment is inactive (for example, country segment), I cannot seem to be able to change its ordering.

petrklus commented 8 years ago

@mkoistinen any idea what may be happening? I am using country segments and the only way to enable full editing is to force them all to be active (and of course allow limit block to be large enough. I have recently upgraded to Django CMS 3.2.5, may this be a factor?

petrklus commented 8 years ago

I have fixed it by adding following code to templates/aldryn_segmentation/_limiter.html:

{% load segmentation_tags cms_tags %}{% comment %}

    NOTE: child_plugins is a list of tuples of the form (instance, Boolean)
    where, instance is the child plugin instance and Boolean represents
    whether the plugin should be rendered in this context.

{% endcomment %}{% for child in child_plugins %}{% render_segment_plugin child.0 child.1 %}{% endfor %}

{% for child in child_plugins %}
    {% if not child.is_renderable and request.toolbar.show_toolbar %}
        <div style="display:none;">    
            {% render_plugin child.0 %}
        </div>    
    {% endif %}
{% endfor %}

My addition is the for loop at the bottom.

petrklus commented 8 years ago

@czpython are you seeing the same issues?

czpython commented 8 years ago

@petrklus Yes, sadly the plugin rendering and toolbar are coupled on the CMS. This makes it quite complicated to not render the plugin but still allow you to edit it. As far as I know, editing the plugin was working fine but moving the plugin is not working at all. We do have plans to fix this on the CMS directly.