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.
How do I change the displayed filename, when I am looking at the node? If somebody uploads doc1.pdf, filefield paths renames it to agreement.doc, and I want it displayed as agreement.doc, how do I accomplish this? Currently, it shows as doc1.pdf. Should I adjust my node-nodetype.tpl.php? Or is there something easier?
Comments
Comment #1
light-blue CreditAttribution: light-blue commentedAfter a little research, this was easy. I copied and pasted theme_filefield into my own module as follows. Is there a better way?
Comment #2
Deciphered CreditAttribution: Deciphered commentedAgreed, this is definitely a must, I came across the same issue myself not long ago.
Will look into a better solution.
Cheers,
Deciphered.
Comment #3
vaporizers CreditAttribution: vaporizers commentedI ended up theming node-nodetype.tpl.php and it worked out very well.
But really... this functionality should be built in...
Comment #4
neRok CreditAttribution: neRok commentedClosing old issue. This sounds like a feature that is in 6.x and 7.x, maybe it was added to 5.x at some stage?