logo

Extra Block Types (EBT) - New Layout Builder experience❗

Extra Block Types (EBT) - styled, customizable block types: Slideshows, Tabs, Cards, Accordions and many others. Built-in settings for background, DOM Box, javascript plugins. Experience the future of layout building today.

Demo EBT modules Download EBT modules

❗Extra Paragraph Types (EPT) - New Paragraphs experience

Extra Paragraph Types (EPT) - analogical paragraph based set of modules.

Demo EPT modules Download EPT modules

Scroll

Remove the label from the "File" field in the comment form.

22/02/2025, by Anonymous (not verified)
Forums

Hello.

Please help me with the following question:

Drupal 7, I created a "File" type field (for attachments) for comments on the forum. Everything is fine, but I need to remove the label of this field in the comment form (for example, on this site - I need to remove the text of the legend element "Attach/File attachments"). It can't be done with standard methods since the label is mandatory; I either need to create a field template and remove the label or, as I understand it, use a hook in the theme's template.php. Neither option is working for me. I created a template for the field named "field--machine_name_of_field.tpl.php", cleared the cache, and tried to output a simple phrase using print. It's not displaying. I'm not sure if I've confused the template name or what. I would appreciate any help/advice/guidance. I'm not new to Drupal, but I understand the basics of the engine's internal structure, and I've solved many questions myself, but I'm stuck here.