Problem/Motivation

When using the Clean Markup module with Omega versions 3 and 4, custom classes are output, but custom attributes do not.

Proposed resolution

Make custom attributes work when using Omega as the base theme.

Remaining tasks

To be done.

User interface changes

Unknown at this time.

API changes

Unknown at this time.

Original report by @yazzybe

Hi, I've tested the module with omega theme 3 & 4.

In both cases the additional 'classes' that I've added show up, but the additional 'attributes' do not show up.

Will the moduel fully support Omega as a base theme in the future ?

Many thanks.

Comments

mparker17’s picture

Title: Omega theme compatible ? » Additional attributes do not appear when using Omega 3 & 4.
Issue summary: View changes

Hmm... I've never tried the module with the Omega theme. I tried looking at the Omega code briefly, but there's a lot of code there...

Could I trouble you to tell me whether you're having trouble with blocks or panels integration? This would make it a lot faster for me to figure out where the problem is happening.

yazzbe’s picture

Thank you for your reply. I have trouble getting the additional attributes in the block wrapper. I've tested Clean Markup with omega 3, 4 and 5 (but I'm currently using version 3.x as a base theme).

Omega uses it's own block.tpl.php code:

<?php $tag = $block->subject ? 'section' : 'div'; ?>
<<?php print $tag; ?><?php print $attributes; ?>>
  <div class="block-inner clearfix">
    <?php print render($title_prefix); ?>
    <?php if ($block->subject): ?>
      <h2<?php print $title_attributes; ?>><?php print $block->subject; ?></h2>
    <?php endif; ?>
    <?php print render($title_suffix); ?>
    
    <div<?php print $content_attributes; ?>>
      <?php print $content ?>
    </div>
  </div>
</<?php print $tag; ?>>

The print $attributes; in the first div is enough to print out the additional css classes in the html for the block, but the additional attributes stored by Clean Markup do not show.

Do you know a way around it? Perhaps a modification to Omega's block.tpl.php ?

Many thanks for your reply.

mparker17’s picture

I don't know if this will work, but you could try replacing Omega's block.tpl.php with the block.tpl.php in clean_markup/modules/clean_markup_blocks.

If that doesn't work, or you want to keep most of Omega's block template, you could try replacing:

<<?php print $tag; ?><?php print $attributes; ?>>

... with...

<<?php print $tag; ?><?php print $attributes . $additional_attributes; ?>>

... but I haven't tested this either, so your mileage may vary.

I'll also look into finding a more-elegant solution (but it's possible that a more-elegant solution does not exist).

yazzbe’s picture

Both suggestions worked for me! I've replaced omega's default block.tpl.php like you suggested.

PS: Maybe it would be nice in the future to add a custom css class to both the content wrapper and the title tag (eg. I originally had 'clearfix' on the content wrapper and 'block-title' on the title). This also is convient when using CSS frameworks.

Many thanks. Your module is absolutly great :)

yazzbe’s picture

Status: Active » Closed (fixed)
mparker17’s picture

Cool, I'm glad that worked and that you like clean_markup!

I've filed #2364815: Add classes to block/panel titles and content to track the feature request in #4 :)