jrief / djangocms-cascade

Build Single Page Applications using the Django-CMS plugin system
MIT License
165 stars 85 forks source link

Bootstrap container plugin does not show in list of plugins that can be added to placeholder #187

Closed darbula closed 8 years ago

darbula commented 8 years ago

Using django-cms==3.3.2 and djangocms-cascade==0.10.1 BootstrapContainerPlugin among others, does not show in Add plugin list.

This issue can be traced to these two recent changes:

Result is that Bootstrap container is not in the list of plugins that can be added to placeholder.

jrief commented 8 years ago

Unfortunately I have to trick out djangoCMS, because otherwise I would be allowed to add rows and columns directly to the placeholder. This can only be done through your settings. For instance, I use:

CACSCADE_WORKAREA_GLOSSARY = {
    'breakpoints': ['xs', 'sm', 'md', 'lg'],
    'container_max_widths': {'xs': 750, 'sm': 750, 'md': 970, 'lg': 1170},
    'fluid': False,
    'media_queries': {
        'xs': ['(max-width: 768px)'],
        'sm': ['(min-width: 768px)', '(max-width: 992px)'],
        'md': ['(min-width: 992px)', '(max-width: 1200px)'],
        'lg': ['(min-width: 1200px)'],
    },
}

CMS_PLACEHOLDER_CONF = {
    'Main Content': {
        'plugins': ['BootstrapContainerPlugin', 'BootstrapJumbotronPlugin'],
        'text_only_plugins': ['TextLinkPlugin'],
        'parent_classes': {'BootstrapContainerPlugin': None, 'BootstrapJumbotronPlugin': None},
        'glossary': CACSCADE_WORKAREA_GLOSSARY,
    },
    ...
}

This allows editor to only add the Container and Jumbotron plugin to the

{% placeholder 'Main Content' %}
darbula commented 8 years ago

Thanks @jrief now it is working fine, although it might be good to leave this issue open or to report to django cms since this settings tweak is more or less workaround.

jrief commented 8 years ago

I believe, this is part of the docs, isn't it?

darbula commented 8 years ago

Yes, it most certainly is in the docs here but what is not obvious that if you do not restrict parent classes user wont even be able to add BootstrapContainerPlugin to the placeholder as a root plugin since it wont be on the list of available plugins. This is not intuitive since parent restriction should not have anything to do with showing plugin in placeholder's add plugin list, does it? It shouldnt be on the list only if parent is required but for BootstrapContainerPlugin it is not required. This might be more of a django cms issue?

rfleschenberg commented 8 years ago

I agree, this is very unintuitive. If we cannot change it, it definitely needs better documentation.

Maybe the lesser evil is to just let the end-user add the rows and columns? Leave it to the site admin to train them not to do it?

rfleschenberg commented 8 years ago

This seems to be the minimal setting that you need:

CMS_PLACEHOLDER_CONF = {
    'content': {  # The name of your main placeholder.
        'parent_classes': {'BootstrapContainerPlugin': None,},
    },
}
rfleschenberg commented 8 years ago

I added a note to the installation docs. Hopefully, this will be sufficient to prevent new users from running into this.