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.
FileField is automatically generating classname attributes with dots in them:
field-icon-application-vnd.openxmlformats-officedocument.wordprocessingml.template
These cannot be properly referenced in CSS, because a.b is a joining reference for two classnames on the same element, not a long single classname. And while you might get away with a\.b to escape the dot, this is a hack and not universally supported by browsers.
Could the . be replaced by a - or -- in the output?
Comment | File | Size | Author |
---|---|---|---|
#2 | translate_dot_to_dash_in_classname-1645544-2.patch | 584 bytes | stuartEngelhardt |
Comments
Comment #1
truyenle CreditAttribution: truyenle commentedSame issue here.
If I upload files with extension as:
.Xltx ---> the module generate a class name: field-icon-application-vnd.openxmlformats-officedocument.spreadsheetml.template
.Dotx ---> the module generate a class name: field-icon-application-vnd.openxmlformats-officedocument.wordprocessingml.template
These can't be reference even though I am using escape character as
.field-icon-application-vnd\.openxmlformats-officedocument\.spreadsheetml\.template
Agree with Stuart if it is turn out like - or -- instead of .
Thanks
Comment #2
stuartEngelhardt CreditAttribution: stuartEngelhardt commentedI found the omission in filefield.theme.inc on line 23. Slashes and Pluses have been being converted, but dots (periods) have not been. I have added dot (period) to the translation array.
Comment #3
quicksketchThanks, I'll make sure to add this to the next release of FileField. In the mean time you can easily override the theme_filefield_icon function in your own template.php file to include the change.
Comment #4
quicksketchThanks, finally committed. Will be in the 3.11 release.
Comment #5
quicksketchClarifying title.