Theme Tutorials

Drupal 6 page template suggestions

In this Drupal tutorial we will look at how to specify a page template file (page.tpl.php) based on the content type of the particular node in question.

This technique will allow us to have different page layouts for different content types (like different templates for regular pages as opposed to stories). The technique is called template suggestion and will indicate to Drupal which files it should look for when determining what page template to use for a node based on the node's content type.

Remove 'Preview' button in Drupal 6 comment form

By default in Drupal 6, there is a 'Preview' button in addition to a 'Save' button in the form which allows a user to post a comment. For those of us who think it is silly to have a preview before posting, the good news is that you can remove the button quite simply with a bit of code.

Place the following code in the template.php file which exists in the directory for the theme that you are using. If your theme does not use a template.php file, go ahead and create one.

This code goes in template.php:

<?php

Disable Resizable Textarea Drupal 6

Drupal 6 allows textareas to be re-sizable and this may be a useful or annoying feature depending on how you look at it. It may be useful since you are allowed to change the size on the fly to suit your needs and may be helpful when adding a lot of content at one time. It may be a nuisance since an extra image (grippie.png) has to be loaded from the server to provide that functionality.

Drupal 6 - Adding an Above Comments Block to a node

In this Drupal tutorial, we will look at how to add a block which comes right before the comments for a node. At times it is necessary to add some content on a node but it should come before (above) the comments for that node. For example, you could want to display an advertisement or links for sharing or any other content like that.

Adding an above contents block can be done in 3 steps as the tutorial below shows.

Remove Homepage Textbox from Comment Form in Drupal 6

In this tutorial, we will look at how to remove the homepage textbox from the default Drupal 6 comment form.

You may want to remove this textbox to clean up the default comment area that Drupal renders out of the box, or you may simply not want users to be able to leave links to their homepage.

Whatever your reason, we will see how to rectify the issue in the tutorial below.

Drupal 6 - How to Remove 'Not Verified' from Anonymous Comments

In this Drupal tutorial, we will look at how to remove the 'Not Verified' which goes next to an anonymous user's name when they post a comment.

To remove 'Not Verified' from anonymous comments in Drupal 6, all you have to do is override an existing function. We do this by editing the "template.php" file (create it if it does not exist) in our theme folder and placing some code inside it. The tutorial below will show you how.