Submitted by Jonathan Henson (not verified) on Wednesday, March 17th, 2010.
First off, thank you for a great starter theme. I am fairly new to Drupal so my question might be a bit newbie :D I’m trying to make a few changes to the comment form. I’ve searched extensively and haven’t found a solution that works. What I’m trying to do is change the way the default name field is filled. I’ve made the field required, and would like to remove the autofill of Guest so that anonymous users must enter their name, or at least enter something. I would also like to remove the homepage field. I’ve looked in the template.php and found this
/** * Override or insert variables into the comment templates. * @param $vars * An array of variables to pass to the theme template. * @param $hook * The name of the template being rendered. */ / function harbormoontheme_preprocess_comment(&$vars, $hook) { $vars['sample_variable'] = t('Lorem ipsum.'); } */
I think I understand the $vars, but I can’t figure out what to put for $hook. Could you give a quick example of what to enter to change the name field?
Comments
#1 Changing the comment form
First off, thank you for a great starter theme. I am fairly new to Drupal so my question might be a bit newbie :D I’m trying to make a few changes to the comment form. I’ve searched extensively and haven’t found a solution that works. What I’m trying to do is change the way the default name field is filled. I’ve made the field required, and would like to remove the autofill of Guest so that anonymous users must enter their name, or at least enter something. I would also like to remove the homepage field. I’ve looked in the template.php and found this
/**
* Override or insert variables into the comment templates.
* @param $vars
* An array of variables to pass to the theme template.
* @param $hook
* The name of the template being rendered.
*/
/
function harbormoontheme_preprocess_comment(&$vars, $hook) {
$vars['sample_variable'] = t('Lorem ipsum.');
}
*/
I think I understand the $vars, but I can’t figure out what to put for $hook. Could you give a quick example of what to enter to change the name field?
Thanks again.
Post new comment