Update the Bluebreeze theme to drupal 6. Bluebreeze is a fairly popular base theme for drupal.

This task doesn't require any coding experience, however some experience will make this task easier. You will learn some basic code-editing skills in PHP, HTML and CSS if you don't already have these skills. You will need to know or learn about web standards, how to validate and why it's important. You will need to learn how to use drupal's CVS code repository, and how to create and submit CVS patches according to drupal's patch guidelines and standards.

You will learn how the theme layer of drupal works and about theming in drupal 5 and 6. This knowledge and these skills are very important when customizing or building any site, and are a great asset if seeking paid drupal work.

The handbook has an extensive article about Converting 5.x themes to 6.x which will be your main resource. It explains all of the changes to the theme layer from drupal 5 to 6.

This task is complete when a patch is submitted to the bluebreeze issue queue that applies cleanly and is stable enough for a beta release of bluebreeze for drupal 6.

Use the resources linked to above.

Bevan will be the owner / mentor of this task and review patches answer questions and make CVS commits. Bevan is a co-maintainer of bluebreeze theme.

This task is on code.google.com and the drupal GHOP project. If you are a GHOP student ant want to claim it, please do so on code.google.com.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Bevan’s picture

ClaimedBy-tranquilityreigns: http://code.google.com/p/google-highly-open-participation-drupal/issues/...

Please contact me so we can exchange contact details and so I can provide better support and mentorship.

Cheers,
Bevan/

DanW’s picture

Sent you a message.

Bevan’s picture

Just for records sake, I just had a chat (skype call) with Dan about this task and how to get started. I sent him a bunch of links about CVS and drupal's repository and we talked about how to set up an environment to work in.

Dan will get back to me once he's got his head around CVS if he needs more help.

DanW’s picture

I've grabbed Drupal and Bluebreeze from CVS head, and so far found that a lot of the theme was already working just fine. The problem I've been trying to fix is with the Bluebreeze-fixed theme, where the sidebars weren't showing up at all. I've managed to get the right sidebar visible, now I just need to try and get it positioned correctly. The left sidebar is still stumping me.

Bevan’s picture

Thanks for the update. If you get REALLY stuck, submit a patch of where you're up to and I'll take a look.

DanW’s picture

FileSize
828 bytes

I think I've gotten myself nicely stuck. I think the problem is I can't seem to figure out why the right sidebar should be any different in the fixed theme then it is in the fluid one. I've gone through all the CSS, but I can't find anything which is making it float down to the bottom of the page.

Here's a patch of what I've done (boy, this dinky thing makes it look like I haven't done anything. :P )

Bevan’s picture

The issue is that the bluebreeze-fixed theme is not using bluebreeze's page.tpl.php. I think it is using drupal's or garland's default page.tpl.php. It's probably also skipping bluebreeze's template.php. I'll let you work out how to fix it. You'll need to understand subthemes in drupal 6.

Also, the change of $left to $sidebar_left broke my install with bluebreeze regular. $sidebar_left is used by many themes, but not bluebreeze. :)

Don't worry about the size of the patch. The number of lines of code has no relation to the amount of work or effort that went in getting the right lines of code. I have spent hours on patches that changed just a few characters! :)

DanW’s picture

The issue is that the bluebreeze-fixed theme is not using bluebreeze's page.tpl.php. I think it is using drupal's or garland's default page.tpl.php. It's probably also skipping bluebreeze's template.php. I'll let you work out how to fix it. You'll need to understand subthemes in drupal 6.

Isn't that what the "base = bluebreeze" line in bluebreeze-fixed.info does? All the info I can find on sub-themes seems to point this way. If not, how would I change that. The Drupal handbook isn't much help here. :\

Then again, maybe I'm really misunderstanding sub-themes. :)

EDIT: With a little more careful reading (darn me and my scanning abilities!), I found this little bit of info.

The internal name of the theme is also derived from this file. For example, if it is named "drop.info", then Drupal will see the name of the theme as "drop". Be sure that no odd characters are used since it will be used for various functions in PHP and therefore have the same limitations. The name should start with an alphabetic character, no spaces or punctuation. Underscores are allowed but no hyphens. Numbers are allowed as long as it is not the first character. Drupal 5 and below used the name of the enclosing folder of the theme.

Bluebreeze Fixed is using hyphens. Might that be causing a problem? Doesn't look like that's a problem. I changed it all to underscores and nothing has been magically fixed. ;)

Bevan’s picture

FileSize
744 bytes

I checkout what zen theme does here. Zen implements subthemes very effectively and might help you with other blocks. It needs to be 'base theme', not 'base'.

We should also implement something like zen's "themer starter kit" for bluebreeze once we've cleaned out the bugs...

DanW’s picture

It needs to be 'base theme', not 'base'.

Oh my. After all that reading and rereading of the porting page, I never noticed that. :( Well, that fixed the sidebar issue. Now I'm getting some other errors, but I'd like to take a shot at them before posting them here. :)

Thanks!

Bevan’s picture

Great!

Michelle’s picture

This is the only one on webchick's list I know anything about and I happen to use this theme so adding this to my tracker in case I can help.

Michelle

DanW’s picture

FileSize
1.45 KB

Ok, I fixed most of the errors it spit out, but I'm having trouble figuring out why it can't find has_terms. I can see in template.php where has_terms is set, but the rest of the theme doesn't seem to like it very much. Here's a patch with all the changes I've made so far.

Any ideas?

aclight’s picture

Status: Active » Needs work
FileSize
18.71 KB

I'm not much of a themer and can't help you with your question above, but I did notice another problem that I didn't see mentioned so far. When using the fixed width version of the theme, the header block seems shifted to the left more than it should be. See the attached screenshot. I looked at this in firebug, and removing the "position: absolute" attribute of the #header-region div seems to fix this, but this might have other side effects.

Keep in mind that you only have 2 days left to finish this, so please try to get this done so you can get credit.

DanW’s picture

Thanks. I had noticed that but was trying to get the coding errors done before messing with the CSS, just in case I did something in the code which required some major CSS changes. (not really sure how likely this is, since I don't know what's causing the error I'm getting) but because of the time constraints, I suppose it would be a good idea to check this out sooner rather than later.

Keep in mind that you only have 2 days left to finish this, so please try to get this done so you can get credit.

Yes. I know this all too well. I'm working as fast I can right now. :)

aclight’s picture

@DanW: Can you be a bit more specific about what problems you have remaining? Maybe a A, B, C, type list. I might be able to help with some of them, but if we at least know what you need to finish up it'll be easier to review, etc.

DanW’s picture

Certainly. Right now there are only these two errors remaining.

  • notice: Undefined variable: has_terms in C:\xampp\htdocs\drupal\themes\bluebreeze\node.tpl.php on line 11.
  • notice: Undefined variable: has_terms in C:\xampp\htdocs\drupal\themes\bluebreeze\node.tpl.php on line 17.

As far as positioning errors etc go, the only one I had noticed (after the big sidebar problem) was the one you brought up; where the header region was too far out to the left.

aclight’s picture

Hm...i'm not actually getting errors on my site, but I might not have the error reporting turned on correctly.

But just by looking at the code, which currently is:
if ($has_terms) :

you could probably get the errors to go away by using:

if (!empty($has_terms)) :

Bevan’s picture

I think the $has_terms issue will be because 'bluebreeze_preprocess_node' in template.php needs to be registered in order to be invoked. I'm not quite sure how that works or if that is the problem. Check the documentation about the d6 theme registry.

Once you have resolved any php errors or warnings, you should test both variations of the theme with different theme options and modules enabled. For example, the search module and it's theme-level display is disabled by default (I think). There are other options that will need testing. See "Toggle display", "Display post information on", logo and icon settings on build/themes/settings, admin/build/themes/settings/bluebreeze and admin/build/themes/settings/bluebreeze-fixed.

Also, if you have time, some cross browser testing would be appropriate; IE6 usually has the most issues. IE7, safari and opera are also important but don't usually have issues.

You're doing well! Cheers,

Bevan/

DanW’s picture

I think the $has_terms issue will be because 'bluebreeze_preprocess_node' in template.php needs to be registered in order to be invoked. I'm not quite sure how that works or if that is the problem. Check the documentation about the d6 theme registry.

Ok, I've looked through the documentation a few times, but to be perfectly honest it hasn't really done anything but confused me. Just about the only thing I've understood is that the PHPTemplate engine does most of the registering for you. I think my general lack of PHP and Drupal themeing experience is killing me here.

Also, if you have time, some cross browser testing would be appropriate; IE6 usually has the most issues. IE7, safari and opera are also important but don't usually have issues.

I can test it on Firefox, Opera, IE7, and Safari (assuming I have time for all of those). Unfortuneatly I don't have any way of testing IE6.

Bevan’s picture

No template.php file is actually needed. We can remove the file and replace if ($has_terms) with if (!empty($terms)).

If you want to keep tracking the issue though, try accepting the $vars parameter by reference with the ampersand function bluebreeze_preprocess_node(&$vars). Also try returning $vars at the end return $vars;.

DanW’s picture

No template.php file is actually needed. We can remove the file and replace if ($has_terms) with if (!empty($terms)).

Thanks. I tried to use the other way, but it still didn't like it so I just did this one.

Now that all the PHP errors are out of the way, I've started on the CSS. aclight's suggestion worked beautifully with the header. Unfortuneatly, the primary links are still missing. I've checked inside page.tpl.php, and the code is still there. As far as I could tell from the handbook page, nothing has changed in how you determine if there are primary links or not.

Bevan’s picture

Make sure you have menu items in the primary menu in admin > build > menu...

DanW’s picture

I do. I can see the menu items on the block on the sidebar, but they aren't showing up in the header.

aclight’s picture

Hm....i see a few problems with this now that I hadn't noticed before. See the attached screenshot for examples.
[Edit: I hit the wrong button. See next comment.]

aclight’s picture

FileSize
44.4 KB

Hm....i see a few problems with this now that I hadn't noticed before. See the attached screenshot for examples.

A.) You can't see it real well here, but this says "Primary links", the title of the Primary links block. The problem is that it's displaying on the far left of the header region. I'm not sure if this is a problem with your theme or not, but if I switch the site to use bluemarine these show up properly. I also noticed that you might be printing the primary and secondary links wrong for D6. Look at the way the garland page.tpl.php file prints primary and secondary links and the way you're doing it. I suspect Garland is doing it the right way.

B.) The search box is too close to the navigation block. I fixed this by removing the #search {height: 22px;} attribute from style.css.

C.) The primary links are way to the right, which might be why you said you couldn't see them at all (it helps to have a very wide monitor). I think this is related to A above.

DanW’s picture

A) I believe I've fixed the problem where the header stuff goes off too far to the left. I also looked at Garland's code, and got the primary/secondary links working. Thanks!

B) Ok. I hadn't enabled the search box yet. I'll look into that.

C) Whoa, those don't even show up on my monitor, but it does appear that you were right. After updating the code to be Drupal 6 compatible, the links should be in the right spot now.

aclight’s picture

I would suggest that you post patches as you fix things (and, for good measure, post them to google as well). You've got about 12 hours left (at the most) to get this closed.

DanW’s picture

FileSize
5.61 KB

Ok, with this patch everything seems to be working quite nicely. :)

aclight’s picture

Dan....looks like you've got windows line endings here on this patch. Can you fix those while I look at the functionality.

aclight’s picture

Ok, the primary links are still messed up, but I'm not sure why. Look at the attached screenshot. The tabs themselves are in the upper right, as you expect them to be. However, the actual link itself is under the header towards the left. That's very strange. Any idea what's going on here?

Bevan’s picture

Status: Needs work » Reviewed & tested by the community
FileSize
5.73 KB

I don't think I was clear in a previous post. By using !empty($terms), we can eliminate the need for $has_terms, bluebreeze_preprocess_node() and and hence template.php.

In this patch I did that. I left the file because I plan to use it in future features / enhancements to the bluebreeze theme.

I removed extra whitespace, implemented a shorthand if statement to simplify, corrected a few indentations. Everything looks good to me and this is patch is sufficient for a beta release of bluebreeze for drupal6.

More extensive testing including all popular browsers is needed for a full release.

That completes the deliverable for this GHOP task -- so it is now complete. Well done Dan! :)

Now I need to find time to learn how to commit, tag, and cut a release...

Bevan’s picture

Status: Reviewed & tested by the community » Fixed

committed and new release created.

Anonymous’s picture

Status: Fixed » Closed (fixed)
Issue tags: +GHOP

Automatically closed -- issue fixed for two weeks with no activity.

Gabrieles’s picture

I have installed bluebreeze version 6.x-1.x-dev, but there was a layout problem: the container was covering the two sidebars.
I fixed it changing one line in page.tlp.php

-     <div id="container" class="<?php if ($sidebar_left) { print "withleft"; } if ($sidebar_right) { print " withright"; }?> clear-block">
+     <div id="container" class="<?php if ($left) { print "withleft"; } if ($right) { print " withright"; }?> clear-block">
Anonymous’s picture

@Superchicken: Can you please edit #35 and add <code></code> tag pairs for the change you made?