Posted on

It's easy to create a custom node with CCK, but what if we want to change how the node looks by default? It's a step up from theming your submitted and your terms code, but it's not really that hard. The main difference between theming the CCK node and the regular node is that in node.tpl.php, we have several content sections within a node, so rather than just printing $content, we will print out parts of the content individually. I will use code from the wallpaper node type of this site for my examples.

Step 0, before we get to the phptemplate part of this tutorial, you have to think to yourself if you really need to theme a specific node programmatically. In many cases, you can style a node just fine with CSS only, so first imagine how you want to theme your node and determine if you really need to get into the templating engine.

Posted on

In this tutorial, we will be adding a container with
metadata about your node to our node template. To see what I mean, look at the
bottom of this node page. Code snippet is plug-and-play, so you can plug it
right into your custom theme, or one of my own Drupal themes.

The box in question can contain any node information
we want, such as link information, to ensure the blogosphere can link to us
effortlessly, or statistical data about our node (hits etc.).

For starters, we're going to add a simple container to
our node that contains a html link, a BBcode link, and the trackback url of our node. Open
up your node.tpl.php file, and add a new div element at the end:

Posted on

If you haven't heard of Magento yet, it's the new open source ecommerce platform that's going to blow ubercart and oscommerce out of the water! A stable version has not yet been released but yet their sourcecode has already been downloaded over 100,000 times. The stable 1.0 version is planned to be releaed in the first quarter of 08, so it won't be long until we see magento shops spawning allover the web. You can check out the demo here

Magento is also going to be integrated with Drupal...

Posted on

This article is the sequel to my first drupal
adsense article
. This time we're going to put adsense blocks in between
teasers, on for example our frontpage. Same as last time, this does not require
any modules, nor does it depend on adsense, it works with any phptemplate-based
theme and with all sorts of ad code.

For starters, we're going to create a new block
region. If there is not a template.php file in your theme folder, create one
and open it up. See if there is a block
regions function, if there is, add a new
block to it: 'betwteasers' =>
t('between teasers')

If you didn't find a block region function copy this
code into your template.php file (this code should be in between <?php and
?> tags):

Posted on

Part 1 - enhancing the
comment layout

When browsing the drupal showcase forum I notice that few people
take the effort the theme the comments, which is strange because comments are
not only a very popular feature, but also exceedingly easy to theme!. For this
comment theming tutorial we're going to spice up the comment template of the
default Garland theme with some additional styling and a date widget just like the one in my latest free drupal theme Delicious Fruit.

Posted on

Lots of interesting stuff has happened to theming Drupal Theming in 2009. The emergence of various theme shops, a pack of new basethemes, and a big improvement in the overall quality of the themes.
Drupal themes are getting better and it looks like this is an ongoing process. Just a few years ago everyone complained that Drupal themes were boring and all looked the same… Joomla and Wordpress were thought to have much better designs available.
From the support emails I get from my premium themes product line I’ve heard from many clients that they’ve switched from Joomla to Drupal because they finally found a theme that matched their needs, so for some users the quality of themes can be a factor of paramount importance for their CMS choice.

Posted on

Ok admittedly most developers will never have to use this trick, but if you ever use color module, or any advanced customization through the theme settings API you will want to do some theming on the theme settings page!

My premium drupal themes in fact do a lot of things with the theme settings form, to name a few: