Snipplet - Checking if drupal block region is empty

Sometimes in theming drupal 6 theme, you will need a function to check if a certain block is occupied or not.

A good example for this practice is to when you are creating a multiple dynamic columns in a theme, like for example there are 3 dynamic columns in your theme called left, center and right.

Theming Ubercart - Tackling the order review page

The out of box ubercart order review page is by far up to the standard of good looking page and it still uses table to layout the page which is quite hard to theme by css.

You can actually override the function in your drupal template.php to utilize div for the element and then theme the page using css.

Snipplet - Modifying User register form destination

Sometimes when you are building a drupal site, you might want to have a custom page where the anonymous user will be redirected after successful registration.

The current standard redirection is to front page, you can change this using the custom-destination module quite easily, but if you are building a custom module sometimes it is faster to redirect the user registration form using drupal hook form-alter.

Theming your user account page

It is an easy task to theme the user account page in drupal 6.

You just really have to copy the user-profile.tpl.php from the user module to your theme directory and begin editing it to your needs.

For example if you want to have a user profile page like a dashboard like page, you can use this snipplet for the user-profile.tpl.php

Naughty Checkbox - Need to make checkbox required in drupal 6?

Drupal 6 as good as it is still have some major quirks and bug that the core just won't update.

One of the famous "little" quirks that is important to some people but never got fixed in the core is the checkbox form field.

This is a scenario where the quirks is completely render drupal 6 unusable...

" your customer wanted to have a custom form that in the end of the form the user must click on the term of service agreement checkbox...."

How can you do that? drupal 6 won't mark the checkbox as "required" , so user can submit the form even when they don't check the checkbox.

Hide Submit module - Fix your impatient user!

If you maintain a site then sometimes you will notice an impatient user or admin who try to click on node submit or edit more than twice.

Sometimes it's not that they wanted it but maybe they think that the node isn't being submitted yet.

To cure this user problematic behavior, you can install the hide submit module.

The module will mask the submit button and change it into a ajax style button with progress bar and as a bonus the modules comes with several good styled progress bar that you can choose from the module configuration panel.

Theming your submitted links

Drupal submitted links is working fine but looks kind of boring?

If you want to have the submitted links looks like the one in many wordpress theme then you can theme it easily from your template.php.

For the submitted links in your node you should use this snipplet :

Ubercart Tableless product grid

If you are using uc_popular module then the snipplet below will be a match for it, otherwise please change the function that points to uc_popular module.

The snipplet below is for theming ubercart default product page into a switchable list view and grid view. The switch will be done using jquery.

The jquery for switching the grid to list view is available as a block in uc_popular module. You can download the beta version of the module in the attachment below this post.

Now put the following function to your template.php

// Template For product Grid

Ubercart Tableless custom product category page

Do you know that you can remove the table html tag and replace it with div tag for your ubercart product category page?

And in implementing a div tag you opens up a new possibility for better page layout and dynamic page layout if you combine it with jquery.

Not to mention its easier to theme a div than a table, although table is harder to break compares to div.

Well to change the ubercart product category page to tabless page, you will need to put the following function into your template.php