Field Format Case - Addressfield Example

Ever wanted your fields in a node add/edit form or a user registration form to contain characters in the same case for formatting reasons? This module addresses this exact issue. An extra fieldset is added to the Manage Field form and allows you to select the case of each column. For example, a simple textfield only contains the value column, whereas an address field contains multiple columns for the country, the city, the area, the postal code etc. The module allows you to select uppercase or lowercase values for each one.

Supported Core + Contrib widgets

Notice: There may more contrib modules supported that I don't know of yet. Feel free to add their widget types in your own implementation of hook_field_format_case_supported_widget_types_alter() and if everything works ok, file a Feature Request to add it. In case, it doesn't work immediately, you may have to also implement hook_field_format_case_element_column_alter(). See the included field_format_case.api.php file for examples and explanations about what each hook does.

FAQ
Q: Does this also work for elements matching the Form API but not the Field API?
A: Well, in this case you won't have a configuration form but you will be able to call field_format_case_format_element_case() in a custom module's hook_form_alter() or hook_form_FORM_ID_alter().

Q: Does this also work for Webform fields?
A: Not right now. You might try to call call field_format_case_format_element_case() in a custom module's hook_form_alter() or hook_form_FORM_ID_alter() though. I believe it should be enough; haven't tested it yet though.

Q: Lowercase, uppercase... Won't there be any camelcase?
A: I believe I should add it in a future release. My current project needs didn't require it and it isn't yet implemented.

Q: Doesn't Field Case contrib module do the same thing?
A: Unfortunately, Field Case doesn't have a stable or dev release yet, but according to its commit, it seems to be developed for D8 only.

Q: D8 version of this module?
A: Not yet. Feel free to file patches though if you really need it and I will pass proper credit.

Project information

Downloads