diff --git a/modules/oe_whitelabel_user_profile/README.md b/modules/oe_whitelabel_user_profile/README.md new file mode 100644 index 000000000..c01c78a98 --- /dev/null +++ b/modules/oe_whitelabel_user_profile/README.md @@ -0,0 +1,3 @@ +# OpenEuropa Whitelabel User Profile + +The scope of this module is to provide templates for theming the User Profile. diff --git a/modules/oe_whitelabel_user_profile/oe_whitelabel_user_profile.info.yml b/modules/oe_whitelabel_user_profile/oe_whitelabel_user_profile.info.yml new file mode 100644 index 000000000..8a9bbfb42 --- /dev/null +++ b/modules/oe_whitelabel_user_profile/oe_whitelabel_user_profile.info.yml @@ -0,0 +1,5 @@ +name: OpenEuropa Whitelabel User Profile +type: module +description: OpenEuropa Whitelabel Theme User Profile. +package: OpenEuropa Whitelabel Theme +core_version_requirement: ^8.9 || ^9.1 diff --git a/modules/oe_whitelabel_user_profile/oe_whitelabel_user_profile.module b/modules/oe_whitelabel_user_profile/oe_whitelabel_user_profile.module new file mode 100644 index 000000000..fb88f5a56 --- /dev/null +++ b/modules/oe_whitelabel_user_profile/oe_whitelabel_user_profile.module @@ -0,0 +1,29 @@ +id() == 'user') { + $oe_fields = [ + 'field_oe_firstname', + 'field_oe_lastname', + 'field_oe_department', + 'field_oe_organisation', + ]; + foreach ($oe_fields as $oe_field) { + if (!empty($fields[$oe_field])) { + $fields[$oe_field]->setDisplayConfigurable('form', TRUE)->setDisplayConfigurable('view', TRUE); + } + } + } +}