Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OEL-481 #51

Open
wants to merge 2 commits into
base: 1.x
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions modules/oe_whitelabel_user_profile/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# OpenEuropa Whitelabel User Profile

The scope of this module is to provide templates for theming the User Profile.
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?php

/**
* @file
* OE Whitelabel user profile module.
*/

declare(strict_types = 1);

use Drupal\Core\Entity\EntityTypeInterface;

/**
* Implements hook_entity_base_field_info_alter().
*/
function oe_whitelabel_user_profile_entity_base_field_info_alter(&$fields, EntityTypeInterface $entity_type) {
if ($entity_type->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);
}
}
}
}