Pages outside cms are overlaid with css cms_structure-dimmer #2706

Closed
worseisbetter opened this Issue Feb 24, 2014 · 13 comments

Comments

Projects
None yet
4 participants
@ghost

ghost commented Feb 24, 2014

Since cms_toolbar is not usable anymore inside blocks, it generally overlays pages outside the cms with css: cms_structure-dimmer. There are use cases when generating a plugin is not an option and django-cms should only be available on a subset of pages. When cms_toolbar was usable inside blocks, this was perfect for that scenario. If we now put cmd_toolbar in the main template for the site, cms_structure-dimmer will overlay the site when toolbar is enabled.

@ghost

This comment has been minimized.

Show comment
Hide comment
@ghost

ghost Feb 24, 2014

it seems this occurs only in certain cases, i'll try to pin it down.

ghost commented Feb 24, 2014

it seems this occurs only in certain cases, i'll try to pin it down.

@FinalAngel

This comment has been minimized.

Show comment
Hide comment
@FinalAngel

FinalAngel Feb 25, 2014

Member

What do you mean by "inside blocks"? Do you have the option to disable the dimmer using some parent css? Maybe @digi604 can give me some insight.

Member

FinalAngel commented Feb 25, 2014

What do you mean by "inside blocks"? Do you have the option to disable the dimmer using some parent css? Maybe @digi604 can give me some insight.

@digi604 digi604 added the frontend label Feb 25, 2014

@digi604 digi604 added this to the 3.0 milestone Feb 25, 2014

@ghost

This comment has been minimized.

Show comment
Hide comment
@ghost

ghost Feb 25, 2014

From the docs:

Be aware that you can not surround the cms_toolbar tag with block tags. The toolbar tag will render everything below it to collect all plugins and placeholders, before it renders itself. Block tags interfere with this.

That's unfortunate for some use cases, when django_cms is only used for one part of a website.

ghost commented Feb 25, 2014

From the docs:

Be aware that you can not surround the cms_toolbar tag with block tags. The toolbar tag will render everything below it to collect all plugins and placeholders, before it renders itself. Block tags interfere with this.

That's unfortunate for some use cases, when django_cms is only used for one part of a website.

@FinalAngel

This comment has been minimized.

Show comment
Hide comment
@FinalAngel

FinalAngel Feb 25, 2014

Member

I know * looking over to @digi604 *

Member

FinalAngel commented Feb 25, 2014

I know * looking over to @digi604 *

@digi604

This comment has been minimized.

Show comment
Hide comment
@digi604

digi604 Feb 25, 2014

Contributor

well if someone figures out how to do that inside a block tag ... you are my hero...

Contributor

digi604 commented Feb 25, 2014

well if someone figures out how to do that inside a block tag ... you are my hero...

@digi604

This comment has been minimized.

Show comment
Hide comment
@digi604

digi604 Feb 25, 2014

Contributor

maybe it is fixable... but not for me before 3.0 release.

Contributor

digi604 commented Feb 25, 2014

maybe it is fixable... but not for me before 3.0 release.

@ghost

This comment has been minimized.

Show comment
Hide comment
@ghost

ghost Feb 25, 2014

it was working before, think 30b4 or so...

ghost commented Feb 25, 2014

it was working before, think 30b4 or so...

@ghost

This comment has been minimized.

Show comment
Hide comment
@ghost

ghost Feb 26, 2014

ok, i found the problem with the dimmer overlay. If you switched to 'structure' mode on any page, the overlay is globally enabled, also on non-cms pages. i'm not sure if this is the intended behavior anyways, wasn't that a page specific switch? al least i seem to recall that state was remembered for every page.

ghost commented Feb 26, 2014

ok, i found the problem with the dimmer overlay. If you switched to 'structure' mode on any page, the overlay is globally enabled, also on non-cms pages. i'm not sure if this is the intended behavior anyways, wasn't that a page specific switch? al least i seem to recall that state was remembered for every page.

@FinalAngel FinalAngel self-assigned this Feb 27, 2014

@ghost

This comment has been minimized.

Show comment
Hide comment
@ghost

ghost Feb 27, 2014

I was just looking in the simplest way to fix this: just check if the current page is a cms page and only then show the toolbar. my first idea was to see if CMS_TEMPLATE is set and just do a conditional check in the template. Unfortunately CMS_TEMPLATE is always set. But perhaps it's better and more user-friendly to generally don't show the toolbar on none cms-page and do the check in the template tag itself (or middleware). i'm not so deep into django_cms to know how to safely check this. if you can give me a hint, i'll happily create a pull request.

ghost commented Feb 27, 2014

I was just looking in the simplest way to fix this: just check if the current page is a cms page and only then show the toolbar. my first idea was to see if CMS_TEMPLATE is set and just do a conditional check in the template. Unfortunately CMS_TEMPLATE is always set. But perhaps it's better and more user-friendly to generally don't show the toolbar on none cms-page and do the check in the template tag itself (or middleware). i'm not so deep into django_cms to know how to safely check this. if you can give me a hint, i'll happily create a pull request.

@FinalAngel FinalAngel assigned digi604 and unassigned FinalAngel Feb 28, 2014

@FinalAngel FinalAngel referenced this issue Feb 28, 2014

Merged

Minor fixes #2766

@digi604

This comment has been minimized.

Show comment
Hide comment
@digi604

digi604 Mar 1, 2014

Contributor

but isn't this just some CSS issue? What do i don't understand? The problem is that you may want to have the toolbar in none cms pages... to be able to use the toolbar there as well.

Contributor

digi604 commented Mar 1, 2014

but isn't this just some CSS issue? What do i don't understand? The problem is that you may want to have the toolbar in none cms pages... to be able to use the toolbar there as well.

@fralud

This comment has been minimized.

Show comment
Hide comment
@fralud

fralud Mar 3, 2014

it's more about a design decision. let's call it oldskool, but i don't like running code somewhere where it's not needed. there is no real advantage of showing the toolbar on a non cms page, rather it's likely you run into some unforced errors. like the one i described (sorry for the username mismatch, just turned the account into an organization):
if you switched on structure mode on a cms page and return on a non cmspage, there is the cms overlay and nothing to see or to do. that's confusing and not much user friendly. and it's not very unlikely that perhaps in the future you change something where you assume the toolbar is on a cms page and forget that this couldn't be the case. nevertheless in the project i'm doing, the cms is only used on a small fraction of the site, so i'd rather disable the toolbar completely and the best way to do it would be in the template. could just disable the css, yes, but that looks more hackish to me and prone for errors in future changes (apart of the fact that there will be code running, as far as i see checking all plugins, for every page call which isn't really necessary).

if anyone could point out a simply way to check via a context variable to see if the page is a cms page, that would be very helpfull and fix my case ;) or how to do a check in contextprocessor and generate a context variable. or even better fix the issue to include the toolbar tag in a block, but i guess that won't be that easy or even possible.

but it's just a minor thing, i totally get that.

fralud commented Mar 3, 2014

it's more about a design decision. let's call it oldskool, but i don't like running code somewhere where it's not needed. there is no real advantage of showing the toolbar on a non cms page, rather it's likely you run into some unforced errors. like the one i described (sorry for the username mismatch, just turned the account into an organization):
if you switched on structure mode on a cms page and return on a non cmspage, there is the cms overlay and nothing to see or to do. that's confusing and not much user friendly. and it's not very unlikely that perhaps in the future you change something where you assume the toolbar is on a cms page and forget that this couldn't be the case. nevertheless in the project i'm doing, the cms is only used on a small fraction of the site, so i'd rather disable the toolbar completely and the best way to do it would be in the template. could just disable the css, yes, but that looks more hackish to me and prone for errors in future changes (apart of the fact that there will be code running, as far as i see checking all plugins, for every page call which isn't really necessary).

if anyone could point out a simply way to check via a context variable to see if the page is a cms page, that would be very helpfull and fix my case ;) or how to do a check in contextprocessor and generate a context variable. or even better fix the issue to include the toolbar tag in a block, but i guess that won't be that easy or even possible.

but it's just a minor thing, i totally get that.

@digi604

This comment has been minimized.

Show comment
Hide comment
@digi604

digi604 Mar 3, 2014

Contributor

{% if request.current_page %}

Contributor

digi604 commented Mar 3, 2014

{% if request.current_page %}

@fralud

This comment has been minimized.

Show comment
Hide comment
@fralud

fralud Mar 3, 2014

thx... for this and all the other work. hope i'll be able to contribute something useful back sometime.

fralud commented Mar 3, 2014

thx... for this and all the other work. hope i'll be able to contribute something useful back sometime.

@FinalAngel FinalAngel closed this Mar 5, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment