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.
I rarely use the labels of a content type. It would be very nice to have all labels hidden by default for all existing and new content types. Is it possible to make a hook or something to add this as a default setting?
Comments
Comment #1
sammarks15 CreditAttribution: sammarks15 commentedWhich labels are you referring to? The labels that are displayed when editing content, or the labels that are displayed when rendering a node?
Comment #2
brian_c CreditAttribution: brian_c commentedCan't imagine why you'd want to hide all labels from the editing form.
So I'm pretty sure he means the rendered labels. I completely agree... 99% of the time after defining fields the first thing you do is go to Manage Display and set all the labels to "Hidden", it's a huge PITA and I wish there was a way to just default labels on new fields to Hidden.
Here is a hook that accomplishes exactly that:
(Bizarrely, $instance does not contain all of the instance settings that were just written to disk, so we have to load & save them ourselves)
Comment #3
mtiftThere will be a configuration system in Drupal 8, but not Drupal 7.
Comment #4
dcam CreditAttribution: dcam commentedComment #6
Lukas von BlarerHow can this be achieved in D8?