Function Overris Tutorials

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

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 shown below.

Open the YOUR-THEME-NAME.info file (located in the folder that belongs to your theme) and add the following line, ideally where the other regions are:

regions[above_comments] = Above Comments

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

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.

Note that you must replace THEME-NAME-HERE with the name of your theme in the function declaration. Note also the troublesome line that has been commented out to solve the problem: