1

I am using contact_form_blocks-7.x-1.x-dev module. Using this module I have embedd contact us form in my website. For themeing I have created file named block--contact.tpl.php. Cleared cache, but it doesnt result anything.
How should I theme this contact us form?

| improve this question | | | | |
0

If you want to theme contact form then you can do it using hook_form_alter().

Use hook_form_alter(&$form, &$form_state, $form_id) in your theme's template.php and alter the form the way you want to theme it.

| improve this answer | | | | |
0

For themeing contact form we can use the FORM_ID which is contact_site_form. The code snippet will be as follows

function myTheme_theme() {
  return array(
'contact_site_form' => array(
'render element' => 'form',
'template' => 'contact-site-form',
'path' => drupal_get_path('theme', 'myTheme').'/templates',
),
  );
}
function myTheme_preprocess_contact_site_form(&$vars) {
$vars['contact'] = drupal_render_children($vars['form']);

}

That should get you the ability to create a template file called contact-site-form.tpl.php.

| improve this answer | | | | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.