Posted by kvoltz on July 6, 2010 at 9:10pm
3 followers
Jump to:
| Project: | Cufón |
| Version: | 6.x-1.0-beta4 |
| Component: | Code |
| Category: | support request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed (won't fix) |
Issue Summary
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
#1
bump
#2
Still no thoughts here? Can anyone help?
Thanks
#3
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.
#4
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!
#5
I added the following to my themes template.php file. Remember to rename the function name 'subcoda_button' to [your theme name]_button.
<?php
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>';
}
?>
#6
Closing this since there is no 6.x maintainer.