Theming the Contact Form
In Drupal 7 its quite easy to theme a contact page. Simply add a snippet in a custom block which will render the contact form for you.
1. Make sure php filter is enabled as an input filter. Go to admin/config/content/formats and add it if its not there. Most possibly the php filter is disabled and needs to be installed. Its a core module, so no downloading needed, simply use drush:
drush en -y php
2. Now simply create a custom block and select the php filter input method. You can add the contact form anywhere by simply adding this snippet:
require_once drupal_get_path('module', 'contact') .'/contact.pages.inc';
print render(drupal_get_form('contact_site_form'));
?>
remember to add the php brackets:
And that is that.
Now you can style a contact form without the hassle of template rewrites!
- Martin Menge's blog
- Log in or register to post comments
