The block titles are always the standard. They are not respecting the block title that we can specify on the block configuration options.

But, besides that, the best Drupal theme ever!!! :)

CommentFileSizeAuthor
#23 deco_block_without_title.patch925 byteselopio
#15 menus.jpg68.54 KBhankpalan.com

Comments

klaasvw’s picture

Assigned: Unassigned » klaasvw
Status: Active » Postponed (maintainer needs more info)

Thanks for reporting this.

I wasn't able to replicate this bug. Could you test it with another theme enabled and see if it happens too?

xmacinfo’s picture

Version: 5.x-1.x-dev » 6.x-1.0
Status: Postponed (maintainer needs more info) » Active

I have Deco on both Drupal 5 and 6.0.

With Drupal 5 block title is displayed or not perfectly. But with Deco on Drupal 6, the title is created even if the block title is empty.

Themer module info:

<div id="block-<?php print $block->module .'-'. $block->delta; ?>" class="block block-<?php print $block->module ?><?php print (isset($block->subject) ? ' block-title' : '') ?><?php print ($zebra ? ' block-'.$zebra : '') ?>">  
  <div class="blockinner">
    <?php if (isset($block->subject)): ?><h2 class="title"><?php print $block->subject; ?></h2><?php endif; ?>
    <div class="content">
      <?php print $block->content; ?>
    </div>    
  </div>
</div>

I switched to Garland on Drupal 6 and the title is not created when the block title is empty. Returning to Deco does create the title again.

scoutbaker’s picture

I cannot reproduce this using either D5.7 or D6.

@xmacinfo: Be sure to use the 6.x-1.x-dev version of Deco. Lots of issues have been resolved there, although I don't remember this being an issue with the 6.x-1.0 release either.

xmacinfo’s picture

Title: Block Titles » Block Titles bar shown even if block title empty
Version: 6.x-1.0 » 6.x-1.x-dev

Actually, I am using 6.x.1.x-dev.

I tried all other themes shipped with Drupal 6, and they all hide the block title bar when the title is empty. The only exeption is Pushbutton, which will always display the block title bar.

I'm using a site upgraded from Drupal 5 to 6.0 with Deco on both. Version 6.0 (with Deco 6.x.1.x-dev) does not have any extra modules enabled.

Any info on what I should look for to fix this issue?

scoutbaker’s picture

The expected behavior for block titles is:
Block title = '' (blank, no entry) -> display the default block title
Block title = 'My text' -> display 'My text' as the block title
Block title = '<none>' -> display no block title

Garland, bluemarine, deco, and others I've tried all follow this and are working. I haven't specifically tried pushbutton.

I would start with a fresh install of D6 and verify that Garland is working as expected. Then try adding deco to the mix and verify that it is working also.

Edit: fixed third option that got stripped out by the filters.

xmacinfo’s picture

The expected behavior for block titles is:
Block title = '' (blank, no entry) -> display the default block title
Block title = 'My text' -> display 'My text' as the block title
Block title = '' -> display no block title

I am confused here. Examples 1 and 3 are the same. They are both blank: "". But one of them default to block title display while the 3rd example do not display the block title.

I would expect that examples 1 and 3 would not display any titles.

Anyway, later I'll do a fresh Deco/Drupal 6 install and see what comes up.

xmacinfo’s picture

Title: Block Titles bar shown even if block title empty » Block Titles bar shown even if block title empty for regions "Bottom content" or "Right sidebar"

It's not all regions that are affected!

I tried to move around the blocks in other block regions of Deco. Same installation as before, though. And the title behavior is not the same on all block regions.

Deco is rich and comes with 9 block regions. Each regions have their own caracteristics. So I discovered that 7 of the 9 regions honor the block title setting and they are not creating the HTML title code. However, when I move the block to the "Bottom content" or "Right sidebar", the title bar or the block will be created, even if the title is blank.

So, there are two regions only that do not respect the block title setting. Is this by design?

Still, later, probably tomorrow, I'll try a fresh install.

scoutbaker’s picture

I don't see this. I had already tested the Right sidebar. I went ahead and tested, but don't see any issues with other regions.

ardarvin’s picture

Oops I just created a new topic addressing exactly this.

I see the exact same behaviour as macinfo.

I'd like to stack blocks on the right sidebar, with no title or title bar background...but the background is displayed, even when you enter .

I'm using the most recent Dev version of the theme, and drupal 6.1.

ardarvin’s picture

for a demo....check http://site2.buildering.net

note that the search, and google ads blocks both have the blank title regions.

scoutbaker’s picture

@ardarvin: Your issue is not the same as that reported by the OP. However I do see that what xmacinfo was saying, is the same as your report, and not the same as the OP.

So my earlier comments are correct with regards to the original issue--if you change the block title, or set it to <none>, the block still shows up with the default block title.

However I do see the issue for the title background area which is what you are reporting. This appears to be what xmacinfo is also referring to.

Since these are really 2 different issues, I think we should move the title background issue to http://drupal.org/node/228548 and just deal with the OP's issue of the default title always being shown in this issue.

@instromaniac: Any preference?

xmacinfo’s picture

Thanks for duplicating my issue.

I did not spend a lot of time on this since that I have a broken arm and that I'm not used working with a single hand.

I will use http://drupal.org/node/228548 for the follow-up.

Please note that Deco for Drupal 5 does not display title and title bg, while deco for 6 does.

scoutbaker’s picture

@xmacinfo: Sorry I was confused about what you were reporting.

xmacinfo’s picture

Sorry for the confusion.

For all regions the bloc title is not created if empty or .

But with regions "Bottom content" or "Right sidebar" the following HTML is created, resulting in the creation of title BG and spacing.

<h2 class="title"></h2>

I believe that empty <h2 class="title"></h2> should not be sent to the browser.

hankpalan.com’s picture

StatusFileSize
new68.54 KB

Ok I'm not a developer, but I needed to get this fixed. So here is what I did, it works, but it might not be the "right" way. So if anybody wants to correct me on what I did, please let me know.

Under the block.tlp.php

I changed: <?php if (isset($block->subject)) to <?php if (!empty($block->subject)) ...so I replaced "isset" with "!empty".

That got rid of the Title area from showing up. But that didn't fix the whole problem.
I still had the background image for the title showing up.
So I went into the style.css...

#sidebar-right .block-title {
background:url(images/rightbar_header_bkg.png) top repeat-x;
padding-bottom: 2px;
background: transparent;
}

#sidebar-right .block h2.title {
font-size: 1.55em;
color: #aaa;
margin: 0;
background:url(images/rightbar_header_bkg.png) top repeat-x;
height: 41px;
padding: .35em .6em 0 .6em;

I added the:
padding-bottom: 2px;
background: transparent;
to the first part.

Then I took the background image url and replaced the ornate one with that...I wasn't using the ornate image anyway. And I had also changed my bkg image to two solid lines instead of the one solid block.

I'm sure I can clean up some of that code, but for now it works. I've added a screenshot.

The search and the ad are their own blocks...but the menus don't show up now!!!!!!!!!!!!

xmacinfo’s picture

You are right and I did use the same fix a few days ago and finally upgraded a site from D5 to D6.1.

I changed: <?php if (isset($block->subject)) to <?php if (!empty($block->subject)) ...so I replaced "isset" with "!empty".

I took the hint from Garland.

As for the CSS part, there are more than a single solution.

I hope the theme developer will be able to fix Deco since it's very well done and deserve a lot of credits.

hankpalan.com’s picture

I'm glad I could help out...I know I was frustrated!

ardarvin’s picture

Thanks spank,

I was actually learning PHP from scratch just to take this on. It's a good thing someone else figured it out, cause I guarantee I would've never found the "isset" thing.

Spank, you may has well clean up your style.css by getting rid of your background:url line, i.e:

#sidebar-right .block-title {
padding-bottom: 2px;
background: transparent;
}

Thanks guys, works like a charm!

deleted_user’s picture

Title: Block Titles bar shown even if block title empty for regions "Bottom content" or "Right sidebar" » Block Titles bar shown even if block title empty
Project: Deco » Drupal core
Version: 6.x-1.x-dev » 6.2
Component: User interface » theme system
Assigned: klaasvw » Unassigned

I have installed drupal 6.2, defined some blocks with the title, and when I change from the default theme to others I see the title of all the blocks, even the block with title.

I have not found a solution to this searching on internet, but trying different things, I have noticed that doing this trick, you can "solve" the problem:

1- Rename the block to something different to and save.
2- Rename again back to and save.

Doing this, I can change to any theme and the changed block seems correctly (without <h2 class="title">).

xmacinfo’s picture

Project: Drupal core » Deco
Version: 6.2 » 6.x-1.x-dev
Component: theme system » Code

This is a Deco 6 issue, and possibly other themes made for Drupal 6.

See also: http://drupal.org/node/228548

Moving this back to Deco issues.

add1sun’s picture

Another issue has been marked a duplicate of this one #228548: Hiding Block Titles AND background box.

scoutbaker’s picture

Marking #300886: Blocks with <none> as title display an empty header as a duplicate, although it does have a patch attached. I have haven't looked at the patch, but the text indicates it makes the same change that was already documented here as being successful.

elopio’s picture

Status: Active » Needs review
StatusFileSize
new925 bytes

Sorry, I didn't find this discussion before.

On the patch attached I changed isset with !empty. It works for me.

klaasvw’s picture

klaasvw’s picture

Status: Needs review » Closed (fixed)

Committed the !empty fix to deco 6.x-1.x-dev. Thanks everyone!