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.
On block view, it would be handy to have the original block delta and module in the new multiblock instance, so that the newly created instance could have a class that displays the original block and delta for styling.
Comment | File | Size | Author |
---|---|---|---|
#11 | multiblock-original-classes-266307-11-D7.patch | 1.33 KB | leeomara |
#1 | multiblock-orig-classes.patch | 1.31 KB | jjeff |
multiblock_orig.patch | 776 bytes | quicksketch | |
Comments
Comment #1
jjeff CreditAttribution: jjeff commentedActually, that patch had some major problems. Here's an updated version that actually works. :-)
Comment #2
quicksketchFor the D5 version the original patch is going to be as good as we can do, we don't get preprocess hooks in D5 :(
Though noted, the block seems to be an array, not an object at that point.
Comment #3
andrewlevine CreditAttribution: andrewlevine commentedquicksketch et al., if this information is useful in the view op, is there any reason we shouldn't include it in all the other ops?
Comment #4
quicksketchAs jjeff informed me, the block object isn't always an object (or array, whatever) during all operations. Though I agree that it would probably be helpful in more operations than just view.
Comment #5
andrewlevine CreditAttribution: andrewlevine commentedquicksketch, now that I think about it, I made the whole multiblock_enabled thing to give you the delta of the block. Couldn't you use that to get the same info?
Comment #6
andrewlevine CreditAttribution: andrewlevine commentedComment #7
NancyDruSomething I thought as I was trying to understand this is that some people have their CSS set up for specific blocks as natively generated. It might be more of a point to somehow tell the theme layer that the original module created the block rather than MB, perhaps with the addition of the instance ID.
Comment #8
NancyDruTo some extent #346513: block-{region}.tpl.php not used is part of this discussion as well.
Comment #9
NancyDruI've been trying something similar to jjeff's patch. In function multiblock_call_block, I did:
And then I modified
block.tpl.php
like this:This passes the original module and delta to the template, which then adds what would have been the original ID as a class (can't nest div's because you could then have duplicate IDs which would fail validation).
This should work in both 5.x and 6.x. The downside is that 5.x users would have to copy the template to their theme directory, which means it's out of our ability to maintain it. However, I think that is a small risk.
Comment #10
intrafusionIssue closed as last post 7 years ago
Comment #11
leeomaraI've updated the patch from #1 to work with current 7.x version of multiblock. The CSS class names now match what block.module does by default.
Comment #13
intrafusion