Code development platform for open source projects from the European Union institutions

Skip to content
Snippets Groups Projects
Commit de93ba79 authored by escuriola's avatar escuriola
Browse files

OEL-579: Add EC/EU theme variable and use it to display EU/EC corporate blocks.

parent 1c9b4810
No related branches found
No related tags found
1 merge request!36OEL-579 - Whitelabel - Medley branch with BCL 0.9.0 upgradel
......@@ -91,3 +91,26 @@ function oe_whitelabel_form_facets_form_alter(&$form, FormStateInterface $form_s
}
}
}
/**
* Implements hook_form_FORM_ID_alter().
*/
function oe_whitelabel_form_system_theme_settings_alter(&$form, FormStateInterface &$form_state, $form_id = NULL) {
$form['component_library'] = [
'#type' => 'select',
'#title' => t('Component library'),
'#options' => [
'ec' => t('European Commission'),
'eu' => t('European Union'),
],
'#default_value' => theme_get_setting('component_library'),
'#description' => t('Choose "European Commission" for websites hosted under the ec.europa.eu domain and "European Union" for websites hosted under the europa.eu domain.'),
];
}
/**
* Implements hook_preprocess().
*/
function oe_whitelabel_preprocess(&$variables) {
$variables['bcl_component_library'] = theme_get_setting('component_library');
}
......@@ -97,7 +97,7 @@
</main>
{% if page.footer %}
{% if "ecfooterblock" in page.footer|keys %}
{% if bcl_component_library == 'ec' %}
<footer class="ec__footer bcl-footer mt-4">
{% else %}
<footer class="bcl-footer mt-4">
......
{% if 'corporateeclogoblock' in navbar_branding|keys %}
{% if bcl_component_library == 'ec' %}
<header class="ec__header bcl-header">
{% else %}
<header class="bcl-header">
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment