Problem with the Left Block Formatting in mydrupal1 theme

in

First of all the mydrupal1 theme is a very cool theme. I know it probably took a lot of time to make it. Good work !!! I really like it and was thinking about using it, but had some small issues.

I experimented with the mydrupal1 theme and can't resolve a problem with the left block theme formatting. It seems like the left side blocks are ignoring the CSS .leftblock { } properties.

I want the left blocks to look like the right side blocks and tried many different ways to accomplish this and can't get it to work.

I even tried making the left block CSS statements identical to the right side statements as shown below, but this fails to work also.

Original code (left / right CSS code):

#sidebar-left {
background-color: #efefef;
width: 14em; /* padding in px not ex because IE messes up 100% width tables otherwise */
padding: 5px;
vertical-align: top;
}

#sidebar-right {
background-color: transparent;
width: 14em; /* padding in px not ex because IE messes up 100% width tables otherwise */
vertical-align: top;
padding: 3px;
}

.rightblock {
color:#333;
padding-bottom: 1px;
padding-left: 5px;
padding-right: 5px;
border-top: 1px solid #d7d7d7;
border-bottom: 1px solid #c7c7c7;
margin: 0 0 1.5em;
background: url("images/rightblock_bg.gif") repeat-y 0% 100%
}

.leftblock {
color:#333;
padding: 5px 7px 7px;
border-top: 1px solid #d7d7d7;
margin: 0 0 1.5em;
background: #f6f6f6 url("images/leftblock_bg.gif") no-repeat 50% 50%
}

Making the left side identical to the right side (left / right CSS code) - this fails to work:

#sidebar-left {
background-color: transparent;
width: 14em; /* padding in px not ex because IE messes up 100% width tables otherwise */
vertical-align: top;
padding: 3px;
}

#sidebar-right {
background-color: transparent;
width: 14em; /* padding in px not ex because IE messes up 100% width tables otherwise */
vertical-align: top;
padding: 3px;
}

.rightblock {
color:#333;
padding-bottom: 1px;
padding-left: 5px;
padding-right: 5px;
border-top: 1px solid #d7d7d7;
border-bottom: 1px solid #c7c7c7;
margin: 0 0 1.5em;
background: url("images/rightblock_bg.gif") repeat-y 0% 100%
}

.leftblock {
color:#333;
padding-bottom: 1px;
padding-left: 5px;
padding-right: 5px;
border-top: 1px solid #d7d7d7;
border-bottom: 1px solid #c7c7c7;
margin: 0 0 1.5em;
background: url("images/rightblock_bg.gif") repeat-y 0% 100%
}

I also tried changing the block CSS references in the page.tpl.php file, switching both the right and left statements, and this also fails to work.

If I use "identical CSS statements" for both the left and right blocks as shown in the above CSS code in the style.css file and then switch the physical location of left blocks with the right blocks in the page.tpl.php file, the right blocks, now on the left side, display the CSS properties of the left blocks... and the left blocks, now on the right, also displays the CSS properties of the left blocks.

In other words, I can't format the left side block to look like the right side ones. The left side blocks are ignoring the CSS .leftblock { } properties.

Any ideas?

Thanks

srmt


Comments

Did you try editing

Did you try editing block.tpl.php

You can remove the if block, which sets, the left and right and just put the code for leftblock in style.css, block section.

So in short remove, left and right block code in css and put everything in block

webmaster | Wed, 2007-01-03 07:08

I found and fixed the

I found and fixed the problem !

There was an error in your original distributed block.tpl.php file.

The 'leftblock' statement should be ' leftblock'

I had to add a space after the apostrophe before the leftblock word as shown below:

Original Line of Code:

module; ?>-<?php print $block->delta; ?>" class="block<?php print " block-$block->module"; ?><?php print ($block->region == 1 || $block->region == 'right') ? ' rightblock': 'leftblock'; ?>">

Fixed Line of Code:

module; ?>-<?php print $block->delta; ?>" class="block<?php print " block-$block->module"; ?><?php print ($block->region == 1 || $block->region == 'right') ? ' rightblock': ' leftblock'; ?>">

Now Drupal will format both left and right blocks correctly bacause it now can read the .leftblock { } CSS parameters in the style.css file.

Also, the supplied image "forum.gif" is not readable because it is actually a jpg file with a gif extension. I had to convert to an actual gif file to make it readable in the browser.

PS. I noticed that I cannot enter a subject title for this reply. There is no Subject edit field.

srmt

srmt | Wed, 2007-01-03 19:36

That was a good catch, I

That was a good catch, I will fix it in my next release...

Yes the subject does not appear when comment box is displayed at bottom. But when you click edit after posting it does appear :)

webmaster | Thu, 2007-01-04 05:23

's points

Points are visible to logged in users only

descriptionvalue
Members3467
Posts224
Comments122
Reads today
Reads all time
Hits today0