Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hi,
I want to output filefield download links as (image) buttons. Is the best solution to override the theme function? If so, how can do I do that? Custom module, in theme layer, copy function, etc?
Help appreciated!
Victor
Comments
Comment #1
kayograco CreditAttribution: kayograco commentedI worked it out by setting the display of the field as "image linked to file" and the css of the anchor field as {display:block; width:(width of image); height:(height of image); background:url("path/of/image");}.
This is not the best solution because I cannot insert a tooltip over the image. Need help on that!
Comment #2
quicksketchYou can override theme_filefield_item() in your template.php file. See the handbook page on overriding themable output: http://drupal.org/node/457740.
Comment #3
MrVictor CreditAttribution: MrVictor commentedOk, thank you!