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.
Is there a way for me to make company street and country required but not zip code?
Thanks. I've been trying to figure it out for a bit.
Comments
Comment #1
RedEight CreditAttribution: RedEight commentedThis can be accomplished with a custom ctools format plugin.
YOUR_MODULE/plugins/format/address_custom_required.inc
This will need to be placed in a folder that ctools has been told is a format plugin directory. You can accomplish that with the following in your YOUR_MODULE/YOUR_MODULE.module
You can adjust the weight as needed to get it to apply in the correct order relative to the other formatters.
Comment #2
bojanz CreditAttribution: bojanz commentedThank you, RedEight!
Feel free to copy your answer to a new documentation page (click "add child page" on https://www.drupal.org/node/1267280), for extra karma ;)