Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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.
Comment | File | Size | Author |
---|---|---|---|
#5 | 1013920-context-html5-support.patch | 9.37 KB | mrfelton |
#4 | context_reaction_block.css_.txt | 4.06 KB | kaido.toomingas |
#4 | context_reaction_block.js_.txt | 14.71 KB | kaido.toomingas |
#1 | context.1013920.patch | 5.51 KB | adamdicarlo |
Comments
Comment #1
adamdicarlo CreditAttribution: adamdicarlo commentedHere'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.
Thoughts?
Comment #2
adamdicarlo CreditAttribution: adamdicarlo commentedComment #3
adamdicarlo CreditAttribution: adamdicarlo commentedSee also #1017718: Node and block hovering doesn't happen in HTML5 themes for contextual module.
Comment #4
kaido.toomingas CreditAttribution: kaido.toomingas commentedThanks.. I used allmost the same with drupal 7 version.
Comment #5
mrfelton CreditAttribution: mrfelton commentedSame 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.Comment #6
mrfelton CreditAttribution: mrfelton commentedPatch 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.
Comment #7
Agileware CreditAttribution: Agileware commentedThis 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.
Comment #8
muschpusch CreditAttribution: muschpusch commentedi can confirm that the patch the works.
Comment #9
adamdicarlo CreditAttribution: adamdicarlo commentedDo 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.
Comment #10
febbraro CreditAttribution: febbraro commentedSweet, thanks for this.
http://drupalcode.org/project/context.git/commit/f8daf81
hefox, marking port in case you want this for D6.
Comment #11
febbraro CreditAttribution: febbraro commentedComment #15
DeaOm CreditAttribution: DeaOm at Agiledrop - Your Trusted Drupal Teammates commented