Problem/Motivation
When using Clean Markup: Blocks with the Bootstrap theme, the title wrapper is not output.
Upon investigation, it appears this is due to the following code in the Bootstrap theme's theme/block/block.vars.php:bootstrap_process_block():
$variables['title'] = $variables['block']->subject;
Proposed resolution
Unknown at this time.
Remaining tasks
Unknown at this time.
User interface changes
Unknown at this time.
API changes
Unknown at this time.
Original report by @meecect
I have selected an h3 tag to wrap the block title, but I only get a raw, unwrapped title. I am using a sub-theme of bootstrap and I fear it may be interfering, but I'm not sure.
I see in the changelog that an issue similar to this was fixed in 2.7, but I am running 2.7 already. I also checked to see if the included block.tpl.php matches the one in my sub theme and it does. I don't see any markup representing wrappers in block.tpl.php related to titles. I suppose it is some preprocess function?
Comments
Comment #1
meecect commentedI found a bootstrap bug for this:
https://www.drupal.org/node/2329431
Comment #2
mparker17I've read through #2329431: bootstrap_preprocess_block() should check if title is already set before overriding it, and looked at
bootstrap_process_block()in the Bootstrap theme'stheme/block/block.vars.php.I'm not entirely certain why the Bootstrap maintainers added that line of code (I haven't looked at the commit history though). Perhaps they were trying to add a backwards-compatibility layer for modules written for Drupal 6?
It's theoretically possible for me to work around this in the Clean Markup module by putting corresponding
$variables['block']->subject = $variables['title']line inclean_markup_blocks_preprocess_block(), but I think that would be a very bad idea because$variables['block']is supposed to be the original block object retrieved from the database: I'm afraid modifying it in that way would open a cross-site-scripting (XSS) attack vector and/or cause problems with other modules...For this reason, I'm going to mark this issue as "won't fix". However, if you can think of a better solution than the one I mentioned in the last paragraph, feel free to re-open the issue and explain your solution.
Comment #3
meecect commentedI agree with you. This is a bootstrap issue, not a clean markup issue.
Comment #4
psiegel commentedHello,
I have the same issue with the Omega 4 theme. It seems the issue comes from the module and the theme using the same variable (title) and overwriting it. And the Zen theme has the same type of issues.
There is already an issue for omega 4 about this: https://www.drupal.org/node/2053877
I am wondering if this should not be taken care of in in clean markup?
Best,
Pascal