Hi Everyone, I am trying to get cufon to work on a series of form input buttons.

Any idea why it wouldn't apply to input button text? It seems to be working just fine elsewhere.

Thanks so much.

Comments

kvoltz’s picture

bump

kvoltz’s picture

Still no thoughts here? Can anyone help?

Thanks

tinker’s picture

Cufon does not work on < input > because there is no location to draw the canvas. You can however theme the < input > tags to use < button > instead and cufon will draw a canvas there.

kvoltz’s picture

hmm... interesting thought. very cool. How would I go about that? Is it a simple matter of replacing my input tag with a button tag, or is there another step involved?

Thanks for the response!

tinker’s picture

I added the following to my themes template.php file. Remember to rename the function name 'subcoda_button' to [your theme name]_button.

function subcoda_button($element) {
  // Make sure not to overwrite classes.
  if (isset($element['#attributes']['class'])) {
    $element['#attributes']['class'] = 'form-'. $element['#button_type'] .' '. $element['#attributes']['class'];
  }
  else {
    $element['#attributes']['class'] = 'form-'. $element['#button_type'];
  }

  return '<button type="submit" '. (empty($element['#name']) ? '' : 'name="'. $element['#name'] .'" ') .'id="'. $element['#id'] .'" value="'. check_plain($element['#value']) .'" '. drupal_attributes($element['#attributes']) .' >'. check_plain($element['#value']) .'</button>';
}
troky’s picture

Status: Active » Closed (won't fix)

Closing this since there is no 6.x maintainer.