As a contrib module, I want to provide a list of fields on my admin settings form. I have the field machine names, but in order to provide a better user experience, I'd like to provide the human-readable names instead.
I'd like a helper function, something like field_get_label()
that would provide the most commonly used label across all instances. I'd also like the matching field_get_labels()
that would provide me with a list of all labels for that field, perhaps keyed by bundle name.
edit: The latest PR also includes a field_get_all_labels()
to get labels for more than one field at a time.
I've done a crazy loop-de-loop in the nodequeue module to get the field labels, but would prefer to have something in core so that every contrib module does not need to do the same.
I expect that if contrib developers are faced with this much work to get a field label, they are likely to print the machine name instead, and be done with it. By providing a utility function we decrease the burden on our contrib developers and are also likely to create a better experience for our end users!
Recent comments
Hello, @yorkshirepudding! Thanks a lot, I got it, all sorted out.
My layout template (layout--blog.tpl.php) doesn't work
Hi @Gnome and welcome to Backdrop When I create custom layout templates I put them in /layouts/custom/my_layout Note: you can split modules and layouts between contrib and custom...
My layout template (layout--blog.tpl.php) doesn't work
This post explains how to do this in Drupal 7. In Backdrop, File Entity is already part of core. You will need to download and install module Views Field View. https://drupal.stackexchange...
I Need to Display an Image in a View that was Uploaded to a Webform