The problem is that HTML5 themes tend to use the <article> tag for blocks rather than <div>, and context's CSS and JS expect blocks always to be divs.

Members fund testing for the Drupal project. Drupal Association Learn more


adamdicarlo’s picture

5.51 KB

Here's a patch that fixes the problem.

I've tested this on a subtheme of boron_zen, and on a non-HTML5 theme (a Zen sub-sub-theme).

This patch makes the selectors a bit looser. The changes:

  • div.block.block
  • div.admin-block.admin-block
  • div.draggable.draggable

div.draggable-placeholder is untouched, as I believe the div there is generated by context.

Is it safe to loosen these selectors? I can't see why not; when would .block be applied to something that isn't a block? And if .block is applied to something else, maybe it should be targeted by context's CSS & JS anyway.


adamdicarlo’s picture

Status: Active » Needs review
adamdicarlo’s picture

kaido24’s picture

Thanks.. I used allmost the same with drupal 7 version.

mrfelton’s picture

Same problem using the Omega HTML 5 theme which uses <section> to markup blocks. Attached is a patch with the changes from #4. Works for me.

mrfelton’s picture

Version: 6.x-3.0 » 7.x-3.x-dev

Patch in #5 is for Drupal 7. I'm bumping the version number for this issue to 7.x-3.x-dev under the assumption that development work is taking place for D7 first, and then being backported.

Agileware’s picture

Priority: Normal » Major

This issue is going to become more and more of an issue and there doesn't seem to be doco on the project page or readme in the inline context editing requirements that blocks must be wrapped in div.block

I have tried the patch in #5 and it seems to work but I have issues with a views slideshow block.
However I also have intermittent problems with views slideshow blocks when using blocks with div.block too so maybe that is unrelated.

muschpusch’s picture

Status: Needs review » Reviewed & tested by the community

i can confirm that the patch the works.

adamdicarlo’s picture

Do the patches need to be updated to support comments, too? (Do HTML5 themes use a new tag for comments?) When I originally wrote the patch it was on a site without comments.

febbraro’s picture

Status: Reviewed & tested by the community » Patch (to be ported)

Sweet, thanks for this.

hefox, marking port in case you want this for D6.

febbraro’s picture

Version: 7.x-3.x-dev » 6.x-3.x-dev

  • mrfelton authored f8daf81 on 8.x-4.x
    Issue #1013920 by mrfelton, muschpusch, kaido24: Make context ui...

  • mrfelton authored f8daf81 on 8.x-0.x
    Issue #1013920 by mrfelton, muschpusch, kaido24: Make context ui...

  • mrfelton authored f8daf81 on 8.x-1.x
    Issue #1013920 by mrfelton, muschpusch, kaido24: Make context ui...