Sunday, September 24, 2017 06:12 am EDT

theming

Bri's picture

Alter the output of Logintoboggan on User Registration Form

Recently I was faced with a problem that gave me a bit of trouble. I was using the Logintoboggan module to create a unified login form as well as to allow logins with username or e-mail address. In addition to using Logintoboggan, I had created a small helper module to remove and alter some of the cruft in the user registration form and the user profile form.

Bri's picture

Theming the Contact Form in Drupal 7 (contact_site_form)

Theming the contact form in Drupal 7 is almost the same as most people did it in Drupal 6, but the one change through me for a loop for quite awhile.

Using Drupal 6, most people would add some code to their template.php file and create something like the following:

DRUPAL 6

function myTheme_theme() {
  return array(
	'contact_mail_page' => array(
					'arguments' => array('form' => NULL),
					'template' => 'contact-form',
					),
	);
}
function myTheme_preprocess_contact_mail_page(&$vars)
{
	$vars['name'] = drupal_render($vars['form']['name']);	
Bri's picture

Template suggestions for Drupal 7 - theme_hook_suggestions

I decided to take some time to figure out how template suggestions work in Drupal 7 being that the release date is getting very close. At the time of this writing Drupal 7 is in RC 4, but they are saying that it will be released officially on January 5th of 2011. I have been working with 7 for a few weeks and finally decided to see if I could get the template suggestions to work. A few things have changed, but they are not that much different from the way they worked in 6. The first difference is that 7 uses a double "-" for its templates by default.

Bri's picture

Using a Custom Image Button with Drupal 6 Search Form or Block

So you decided that you want to use an image instead of styling the inputs for the Drupal search block or form. Luckily, this isn't a difficult task at all. Using the hook_form_alter you can accomplish this. You will need to create a small module in order to make this happen. I called mine "modified_search". Here is what the .info file looks like:


; $Id:
name = Modified Search
description = Inject the search how i want it to look.
package = Other
version = VERSION
core = 6.x

And now for the contents of the .module file:

Bri's picture

Create Custom Drupal 6 Search Box and Theme It

If you are looking for a way to customize the search box in Drupal 6, here are some suggestions that may prove helpful. This info pertains to the search that is built into some themes rather than the search block.

The core search module specifies that the template to be used for the search_theme_form should be search-theme-form.tpl.php. If you theme doesn't already have this file included, you can copy it from the core search module folder.

Syndicate content