Jump to:
| Project: | Block Class |
| Version: | 6.x-1.1 |
| Component: | Code |
| Category: | support request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed (fixed) |
Issue Summary
Alright, let me know what I'm doing wrong here. I'm using Drupal 6 with the Newswire theme (by AdaptiveThemes).
block.tpl.php before modification:<div id="block-<?php print $block->module .'-'. $block->delta; ?>" class="block <?php print $block_classes; ?>">
block.tpl.php after modification:<div id="block-<?php print $block->module .'-'. $block->delta; ?>" class="block <?php print $block_classes; ?> <?php if (function_exists(block_blankblock)) print block_blankblock($block); ?>">
style.css snippet
.blankblock {
border: none;
background: #FFF;
padding: 0 0 0 0;
margin: 0;
}In the block I want to apply this class to, I've specified "block_blankblock" or "blankblock". I still have borders on the block I'm applying it to.
I also tried this with the string 'block_blankblock' in block.tpl.php as 'blankblock', since I wasn't sure about the required syntax.
So, what am I doing incorrectly here?
Comments
#1
m.rademacher:
block_blankblock($block);doesn't mean anything. There is no function calledblock_blankblock()-- unless you defined it yourself.You need to follow the instructions exactly as they appear on the project page. You do not need to change the PHP snippets at all. Replace this:
<?php if (function_exists(block_blankblock)) print block_blankblock($block); ?>...with this:
<?php if (function_exists(block_class)) print block_class($block); ?>The final result will be:
<div id="block-<?php print $block->module .'-'. $block->delta; ?>" class="block <?php print $block_classes; ?> <?php if (function_exists(block_class)) print block_class($block); ?>">On a side note, I see your theme is using the variable
$block_classes. You can add the Block Class module's output to the definition of that variable -- which is probably located in template.php -- to avoid changing block.tpl.php if you choose. (But if none of that made any sense, just ignore it! The solution outlined above will work fine.)#2
Thanks for the quick response.
I've updated block.tpl.php with the exact snippet from the main page and here. I figured I had something wrong.
It's still not working, however. I add blankblock (the class I defined in style.css) to the CSS class box for the blocks I want to have no border, and they still have a border. Any idea what I'm doing wrong still?
#3
m.rademacher:
Does the block actually output the .blankblock class? That is, does your XHTML output actually show "blankblock" in the class attribute for the desired block? If so, this isn't an issue with the Block Class module -- it's an issue with CSS inheritance or something else at the theme layer.
#4
Here's what's output to the page source for this section of the page:
<!-- RIGHT 2 -->
<div id="right_2" class="width-10-190">
<div id="block-block-56" class="block block-block region-odd odd region-count-1 count-7 blankblock">
<div class="block-wrapper">
<div class="content">
<p class="rtecenter"><img width="170" alt="Progressive Crush Animation" src="../../images/pc_iso.gif" /> </p>
<p> </p>
<p> </p>
<p class="rtecenter"><img align="center" alt="Chemical Process" src="../../images/steamimage.png" /></p> </div>
</div> <!-- /block-warpper -->
</div> <!-- /block -->
</div> <!-- /right 2 -->
<!-- RIGHT -->
The string "blankblock" appears in the class attribute, I assume that's what you mean (I'm rather new to CSS). So what do I do to fix this thing?
#5
m.rademacher:
In this case, the Block Class module is working exactly as expected, so your problem lies with the CSS. You should employ some web design and debugging tools to figure out where and why the CSS you've written is being overridden by something else. Check out the Firefox addons Firebug and Web Developer toolbar. I also suggest reading some CSS tutorials to get the basics down.
#6
Automatically closed -- issue fixed for 2 weeks with no activity.