ec-europa / oe_theme
OpenEuropa base theme.
Installs: 442
Dependents: 1
Suggesters: 0
Security: 0
Stars: 32
Watchers: 28
Forks: 32
Open Issues: 108
Type:drupal-theme
Requires
- php: >=8.1
- cweagans/composer-patches: ~1.4 || ^2.0
- drupal/core: ^10
- drupal/smart_trim: ^2
- drupal/stable: ^2.0
- drupal/twig_field_value: ^2.0
- drupal/ui_patterns: ^1.5
- openeuropa/ecl-twig-loader: ^4.0
- openeuropa/oe_time_caching: ^1.5
Requires (Dev)
- behat/mink-selenium2-driver: ~1.6.0
- composer/installers: ~1.5
- drupal/address: ~1.11
- drupal/ckeditor: ^1.0
- drupal/composite_reference: ^2.1
- drupal/config_devel: ^1.9
- drupal/core-composer-scaffold: ^10
- drupal/core-utility: ^10
- drupal/datetime_range_timezone: ^1.0.0-alpha4
- drupal/datetime_testing: ^1.0
- drupal/description_list_field: ^1.0
- drupal/drupal-extension: ^5.0
- drupal/emr: ^1.3
- drupal/entity_browser: ^2.5
- drupal/entity_reference_revisions: ~1.11
- drupal/extra_field: ^2.1
- drupal/field_group: ~3.2
- drupal/inline_entity_form: ~1.0-rc15
- drupal/json_field: ^1.2
- drupal/renderviz: ^1.0@alpha
- drupal/styleguide: ^2.1.1
- drupal/typed_link: ^2.0
- drush/drush: ~12
- friends-of-behat/service-container-extension: ^1.0
- mikey179/vfsstream: ^1.6.10
- nikic/php-parser: ^4.18
- openeuropa/behat-transformation-context: ^0.2
- openeuropa/code-review: ^2.0.0-alpha6
- openeuropa/oe_contact_forms: ^1.14
- openeuropa/oe_content: ^4.0.0
- openeuropa/oe_corporate_blocks: 4.x-dev
- openeuropa/oe_corporate_countries: ^2.0.0
- openeuropa/oe_corporate_site_info: ^1.0.0-alpha8
- openeuropa/oe_media: ^1.27
- openeuropa/oe_multilingual: ^1.18
- openeuropa/oe_paragraphs: ^1.20
- openeuropa/oe_search: ^2.0@beta
- openeuropa/oe_webtools: ^1.23
- openeuropa/rdf_skos: ^1.0.0
- openeuropa/task-runner-drupal-project-symlink: ^1.0.0-beta6
- phpspec/prophecy-phpunit: ^2
- symfony/phpunit-bridge: ^6.0
Conflicts
- openeuropa/oe_corporate_blocks: <=4.19.2
- 4.x-dev
- 4.3.0
- 4.2.1
- 4.2.0
- 4.1.0
- 4.0.1
- 4.0.0
- 4.0.0-beta8
- 4.0.0-beta7
- 4.0.0-beta6
- 4.0.0-beta5
- 4.0.0-beta4
- 4.0.0-beta3
- 4.0.0-beta2
- 4.0.0-beta1
- 3.x-dev
- 3.10.0
- 3.9.0
- 3.8.0
- 3.7.0
- 3.6.0
- 3.5.2
- 3.5.1
- 3.5.0
- 3.4.1
- 3.4.0
- 3.3.0
- 3.2.0
- 3.1.1
- 3.1.0
- 3.0.0
- 3.0.0-beta18
- 3.0.0-beta17
- 3.0.0-beta16
- 3.0.0-beta15
- 3.0.0-beta14
- 3.0.0-beta13
- 3.0.0-beta12
- 3.0.0-beta11
- 3.0.0-beta10
- 3.0.0-beta9
- 3.0.0-beta8
- 3.0.0-beta7
- 3.0.0-beta6
- 3.0.0-beta5
- 3.0.0-beta4
- 3.0.0-beta3
- 3.0.0-beta2
- 3.0.0-beta1
- 3.0.0-alpha1
- 2.x-dev
- 2.20.2
- 2.20.1
- 2.20.0
- 2.19.0
- 2.18.0
- 2.17.1
- 2.17.0
- 2.16.0
- 2.15.1
- 2.15.0
- 2.14.0
- 2.13.0
- 2.12.3
- 2.12.2
- 2.12.1
- 2.12.0
- 2.11.x-dev
- 2.11.1
- 2.11.0
- 2.10.x-dev
- 2.10.3
- 2.10.2
- 2.10.1
- 2.10.0
- 2.9.0
- 2.8.0
- 2.7.0
- 2.6.0
- 2.5.1
- 2.5.0
- 2.4.2
- 2.4.1
- 2.4.0
- 2.3.1
- 2.3.0
- 2.2.0
- 2.1.3
- 2.1.2
- 2.1.1
- 2.1.0
- 2.0.0
- 2.0.0-beta2
- 2.0.0-beta1
- 2.0.0-alpha4
- 2.0.0-alpha3
- 2.0.0-alpha2
- 2.0.0-alpha1
- 1.x-dev
- 1.7.0
- 1.6.0
- 1.5.1
- 1.5.0
- 1.4.0
- 1.3.0
- 1.2.0
- 1.1.0
- 1.0.0
- 0.4881.202410250915
- 0.4881.202410231735
- 0.4872.202412121135
- 0.4872.202412051240
- 0.4865.202410181235
- 0.4833.202410231910
- 0.4833.202410231545
- 0.4793.202410010835
- 0.4793.202409301725
- 0.4793.202409301630
- 0.4770.202409161225
- 0.4758.202410251100
- 0.4758.202410141700
- 0.4758.202410111517
- 0.4730.202410041125
- 0.4730.202410021440
- 0.4730.202409301755
- 0.4697.202409021400
- 0.4697.202408301310
- 0.4689.202408231515
- 0.4674.202408191335
- 0.4674.202408151215
- 0.4674.202408151055
- 0.4591.202408080920
- 0.4591.202408080830
- 0.4591.202408071345
- 0.4556.202408281413
- 0.4556.202408231300
- 0.4556.202408141512
- 0.4551.202407251740
- 0.4551.202407251655
- 0.4551.202407241925
- 0.4551.202407231935
- 0.4551.202407220930
- 0.4509.202407191650
- 0.4509.202407151340
- 0.4509.202407091810
- 0.4509.202407081630
- 0.4509.1
- 0.4416.3
- 0.4416.2
- 0.4416.1
- 0.4386.1
- 0.4370.2
- 0.4370.1
- 0.4370.0
- 0.4366.3
- 0.4366.2
- 0.4366.1
- 0.4321.202409051145
- 0.4314.2
- 0.4303.1
- 0.4293.1
- 0.4288.1
- 0.4283.2
- 0.4283.1
- 0.4280.1
- 0.4198.1
- 0.4162.2
- 0.4162.1
- 0.4139.2
- 0.4139.1
- 0.4124.2
- 0.4124.1
- 0.4085.11
- 0.4085.10
- 0.4085.9
- 0.4085.8
- 0.4085.7
- 0.4085.6
- 0.4085.5
- 0.4085.4
- 0.4085.3
- 0.4085.2
- 0.4085.1
- 0.4032.5
- 0.4032.4
- 0.4032.3
- 0.4032.2
- 0.4032.1
- 0.3987.1
- 0.3957.202402151258
- 0.3957.202402141521
- 0.3957.202402141500
- 0.3916.1
- 0.3912.4
- 0.3912.3
- 0.3912.2
- 0.3912.1
- 0.3889.202401111437
- 0.3889.202401111100
- 0.3884.2
- 0.3884.1
- 0.3882.2
- 0.3882.1
- 0.3875.202401161200
- 0.3875.202401161125
- 0.3875.202401141430
- 0.3875.3
- 0.3875.2
- 0.3875.1
- 0.3865.202301100900
- 0.3865.4
- 0.3865.3
- 0.3865.2
- 0.3846.20240116
- 0.3844.2
- 0.3844.1
- 0.3831.202312141300
- 0.3828.202312171200
- 0.3828.202312151325
- 0.3816.202403061300
- 0.3816.202402080845
- 0.3816.202402061550
- 0.3816.202402061155
- 0.3816.202401301830
- 0.3816.202401301350
- 0.3810.202312141835
- 0.3777.202401091154
- 0.3737.202311141155
- 0.3737.202311071555
- 0.3723.202310311055
- 0.3723.202310301922
- 0.3676.3
- 0.3676.2
- 0.3676.1
- 0.3652.202310031925
- 0.3635.3
- 0.3635.2
- 0.3635.1
- 0.3626.202310311310
- 0.3626.202310200900
- 0.3626.202310161100
- 0.3626.202309251815
- 0.3603.202309182100
- 0.3602.202309131525
- 0.3602.202309131520
- 0.3602.202309121715
- 0.3592.202309121552
- 0.3479.202309011425
- 0.3479.202308201325
- 0.3479.202308180840
- 0.3479.202308071530
- 0.3479.202308021045
- 0.3324.202306090855
- 0.3324.202306090840
- 0.3324.202305301135
- 0.3321.202306091340
- 0.3321.202306090835
- 0.3321.202306071020
- 0.3321.202306061940
- 0.3310.202305161200
- 0.3310.202305151450
- 0.3240.202305241405
- 0.3137.202303081555
- 0.2792.202303201830
- 0.2792.202303201730
- 0.2792.202303140950
- 0.2792.202303140945
- 0.17.0
- 0.16.0
- 0.15.1
- 0.15.0
- 0.14.1
- 0.14.0
- 0.13.2
- 0.13.1
- 0.13.0
- 0.12.0
- 0.11.0
- 0.10.0
- 0.9.0
- 0.8.0
- 0.7.0
- 0.6.3
- 0.6.2
- 0.6.1
- 0.6.0
- 0.5.1
- 0.5.0
- 0.4.202412090902
- 0.4.202410240825
- 0.4.202410040820
- 0.4.202408291140
- 0.4.202408281407
- 0.4.202408231330
- 0.4.202408111010
- 0.4.202408021035
- 0.4.202407231300
- 0.4.202407220905
- 0.4.202404111200
- 0.4.202403181735
- 0.4.202403131345
- 0.4.13
- 0.4.12
- 0.4.11
- 0.4.10
- 0.4.9
- 0.4.8
- 0.4.7
- 0.4.6
- 0.4.5
- 0.4.4
- 0.4.3
- 0.4.2
- 0.4.1
- 0.4.0
- 0.3.202401151000
- 0.3.202401121155
- 0.3.202401091520
- 0.3.202401091455
- 0.3.202311131410
- 0.3.202311130925
- 0.3.202310171120
- 0.3.202309131720
- 0.3.202309121115
- 0.3.202306211110
- 0.3.202306191400
- 0.3.202306081430
- 0.3.202303091835
- 0.3.202303061220
- 0.3.202303021400
- 0.3.202303011652
- 0.3.1
- 0.3.0
- 0.2.0
- 0.1.0
- dev-EWPP-4999
- dev-EWPP-4953
- dev-EWPP-5047
- dev-EWPP-4578
- dev-release-4.2.0
- dev-release-4.1.0
- dev-EWPP-4833
- dev-EWPP-4793-test
- dev-release-4.0.1
- dev-EWPP-4697
- dev-contribution/UCPKN-3176
- dev-JMSITE-340
- dev-EWPP-4288
- dev-release-4.0.0-beta6
- dev-FRONT-4288-Menu-keyboard
- dev-FRONT-4293-Carousel-height
- dev-FRONT-4280-Featured-item-background
- dev-FRONT-4283-Menu-position
- dev-EWPP-3561
- dev-EWPP-4102
- dev-EWPP-4032
- dev-EWPP-3846
- dev-update-4.x
- dev-EPIC-EWPP-3676-ECL-v4
- dev-EWPP-3844
- dev-EWPP-3676-fix-oe_content-patch
- dev-EWPP-3871
- dev-EWPP-3678-build-dev-ecl
- dev-ewpp-3826-remove-spaceless
- dev-EWPP-3761
- dev-EWPP-3678-change-build-script
- dev-EWPP-3594
- dev-dependabot/npm_and_yarn/moment-2.29.4
- dev-UCPKN-2278-do-not-merge
- dev-release-3.5.0
- dev-release-3.4.x
- dev-release-3.4.1
- dev-EWPP-3421
- dev-EPIC-EWPP-3269-Banner-Carousel
- dev-EWPP-2792
- dev-update-3.x
- dev-release-3.0.x
- dev-EWPP-2831
- dev-EWPP-2790
- dev-EPIC-EWPP-2575
- dev-EPIC-EWPP-2506
- dev-EPIC-EWPP-2556
- dev-update-after-release-3.0.0-beta17
- dev-rebased-3.x
- dev-backup-3.x-2022-10-14
- dev-release-3.0.0
- dev-update-release-3.0.0
- dev-issue-1176-admin-toolbar-search
- dev-EWPP-2557
- dev-release-3.0.0-beta14
- dev-EPIC-EWPP-2106-Carousel
- dev-EWPP-2106-fix
- dev-EPIC-EWPP-2022-External-links
- dev-EPIC-EWPP-2204-Simple-Teaser
- dev-EWPP-2328
- dev-EWPP-2069-config
- dev-EWPP-2044
- dev-EWPP-2149
- dev-EWPP-2070
- dev-EWPP-1875
- dev-EPIC-EWPP-1539-Event-v2
- dev-EPIC-EWPP-1861-list-with-illustrations
- dev-update-EPIC-EWPP-1861-list-with-illustrations-20220125
- dev-EWPP-1863
- dev-EWPP-1779
- dev-OEL-775
- dev-EPIC-EWPP-755-Highlighted
- dev-EWPP-1728
- dev-EWPP-1756-2
- dev-EWPP-1786
- dev-EPIC-EWPP-755-update
- dev-update-EPIC-EWPP-1539-Event-v2-20211118
- dev-update-EPIC-EWPP-1539-Event-v2-20211109
- dev-EWPP-1268
- dev-EWPP-1575-3x
- dev-EWPP-1576
- dev-EWPP-1575-2x
- dev-EWPP-1478
- dev-EWPP-1575-2.x
- dev-EPIC-EWPP-1360-News-v3
- dev-EPIC-EWPP-873-Text-media-2
- dev-EWPP-1362-2
- dev-EWPP-1449
- dev-EWPP-1457
- dev-EWPP-1304
- dev-EWPP-1339-3.x
- dev-EWPP-1345
- dev-EPIC-EWPP-1142-theme-ECL-v3
- dev-EWPP-1149
- dev-origin/update-EPIC-EWPP-1142-theme-ECL-v3-20210720
- dev-EWPP-1288
- dev-EWPP-968
- dev-EWPP-1317
- dev-EWPP-1324
- dev-EWPP-1277
- dev-changelog-2.20.2
- dev-EWPP-1237
- dev-EWPP-1148
- dev-EWPP-941
- dev-EWPP-1241-2
- dev-EWPP-1188
- dev-EWPP-1241
- dev-update-EPIC-ECL-v3
- dev-EWPP-1239
- dev-EWPP-685
- dev-EWPP-1230
- dev-EWPP-1049
- dev-EWPP-1112
- dev-EPIC-EWPP-851-In-Page-Nav
- dev-EPIC-EWPP-953-Organisation
- dev-EPIC-EWPP-1041-Contacts
- dev-update-EPIC-EWPP-1041-Contacts31052021
- dev-EWPP-1096
- dev-EWPP-952
- dev-EWPP-000-fix-install-instructions
- dev-EPIC-EWPP-851-In-Page-Nav-rebase
- dev-release-2.18.x
- dev-Update-Org-Epic
- dev-EWPP-989
- dev-EWPP-1059
- dev-update-EPIC-EWPP-1041-Contacts-06052021
- dev-EWPP-1047
- dev-EWPP-402
- dev-release-2.17.x-into-2.x
- dev-EWPP-992
- dev-release-2.17.x
- dev-EWPP-987
- dev-EWPP-990
- dev-EPIC-EWPP-945-drop-legacy-ECL-presets
- dev-person-epic-rebase
- dev-EWPP-798
- dev-EWPP-720
- dev-EWPP-812
- dev-EPIC-EWPP-257-Taxonomy
- dev-EWPP-640
- dev-EWPP-747
- dev-EWPP-716
- dev-EWPP-664
- dev-EWPP-164B
- dev-EWPP-508
- dev-EWPP-440
- dev-EWPP-565
- dev-EWPP-626
- dev-EWPP-615-fix-site-info-version
- dev-EWPP-675
- dev-EPIC-Multilingual
- dev-EWPP-441-2
- dev-2.11.1-release
- dev-EWPP-635-2
- dev-release-2.12.x
- dev-bump-oe-corporate-blocks-conflict
- dev-EWPP-583
- dev-EPIC-footer
- dev-EPIC-Proposals
- dev-EWPP-483-2x
- dev-EWPP-483-on-EWPP-435-2
- dev-EWPP-435
- dev-EWPP-543
- dev-EWPP-441
- dev-release-2.10.x
- dev-EWPP-394
- dev-EPIC-News
- dev-EWPP-349-organisation
- dev-fix-lowest-2
- dev-debug-lower-failure-javascript
- dev-debug-lower-failure
- dev-EWPP-125
- dev-EWPP-307
- dev-EWPP-284-navigation-block
- dev-EWPP-287
- dev-EWPP-270
- dev-EPIC-tender
- dev-EWPP-295
- dev-EWPP-272
- dev-EWPP-208
- dev-EWPP-221
- dev-EPIC-organisation
- dev-update-organisation-16092020
- dev-EPIC-project
- dev-EWPP-164
- dev-EWPP-249
- dev-EWPP-43
- dev-EWPP-55-2-refactorying
- dev-D8TEWPPE-77
- dev-EWPP-164-julien
- dev-EWPP-127
- dev-EPIC-Project-update-20200819
- dev-EPIC-Project-update-20200818
- dev-EWPP-33
- dev-EWPP-113
- dev-FPFISSUPP-8617
- dev-use-percona-5.7
- dev-EWPP-55
- dev-EWPP-31
- dev-EPIC-contact_forms
- dev-merge-2.4.x-in-2.x
- dev-release-2.4.x
- dev-release-2.3.x
- dev-Tiago-FM-patch-1
- dev-SGECI2-370
- dev-release-2.1.x
- dev-OPENEUROPA-0000-drone-cache
- dev-master
- dev-NOT-MERGE
- dev-OPENEUROPA-2259-2.x
- dev-ISSUE-293
- dev-add-sidebar-to-page-template
- dev-UPGRADE-HOTFIX
This package is auto-updated.
Last update: 2024-12-17 11:22:08 UTC
README
Drupal 10 theme based on the Europa Component Library (ECL).
Table of contents:
- Requirements
- Installation
- Companion sub-modules
- Corporate blocks
- Image styles
- Development
- Contributing
- Versioning
Requirements
This depends on the following software:
Installation
The recommended way of installing the OpenEuropa theme is via Composer.
Before proceeding, please note that theme releases are built by a continuous integration system, and include code coming
from third-party libraries, such as ECL templates and other assets. Simply Running composer require openeuropa/oe_theme
will download the raw theme source code, which misses required third-party code.
In order to instruct Composer to download the actual built artifact, you need to require and configure the Composer Artifacts project. To do so run:
composer require openeuropa/composer-artifacts
Then add the following section, in your project's composer.json
:
"extra": {
"artifacts": {
"openeuropa/oe_theme": {
"dist": {
"url": "https://github.com/{name}/releases/download/{pretty-version}/{project-name}-{pretty-version}.tar.gz",
"type": "tar"
}
}
},
}
Once you are done, run:
composer require openeuropa/oe_theme
This will download the fully built artifact, as opposed to the raw theme source code.
If you are not using Composer, then simply download a release artifact here (i.e. a oe_theme-[x.y.z].tar.gz
file)
and install it as described here.
Enable the theme
In order to enable the theme in your project perform the following steps:
- Enable the OpenEuropa Theme Helper module
./vendor/bin/drush en oe_theme_helper
- Enable the OpenEuropa Theme and set it as default
./vendor/bin/drush theme:enable oe_theme
./vendor/bin/drush config-set system.theme default oe_theme
Step 1. is necessary until the following Drupal core issue is resolved. Alternatively you can patch Drupal core with this patch and enable the theme: the patched core will then enable the required OpenEuropa Theme Helper module.
The OpenEuropa theme supports both the EC and EU component libraries:
- Use the "European Commission" component library for European Commission websites hosted under the
ec.europa.eu
domain - Use the "European Union" component library for European Union websites hosted under the
europa.eu
domain
The theme uses the "European Commission" component library by default, you can change that by visiting the theme setting page.
Note for developers: changing the component library will only load different CSS and JS assets, the actual HTML is the same between the two libraries.
Each component library can use one of the following ECL brandings:
- Standardized: standardised websites host thematic content owned by a specific DG/Agency. This is the default solution to host DG-specific content (policy) and is closely aligned with the core site.
- Core: core websites host general information shared by different websites or departments and serve as hubs for onward navigation to further thematic content and/or specific services. For example, the main European Commission website (https://ec.europa.eu) uses ECL core branding.
To learn more about EC/EU families and ECL branding visit the ECL website.
Upgrade to 4.0.0
The following patterns have been removed:
banner_hero
banner_page
social_media_links_horizontal
social_media_links_vertical
The following variants of the button pattern have been removed:
form
form_primary
splash_page
The language_switcher
field of the page_header
pattern has been removed.
The additional_information
field of the list_item
pattern has been removed.
The text_highlight
and image_overlay
variants fo the banner
pattern have been replaced by a single variant
text_overlay
.
Two ECL components have been replaced:
- Message component (
twig-component-message
) replaced by Notification component (twig-component-notification
) - Language list component (
twig-component-language-list
) replaced by Splash page (twig-component-splash-page
)
Colors
In order to accommodate the color changes in ECL 4.0.0 we have added two twig functions to determine the correct color for border and background based on the component library (European Union or European Commission):
ecl_class_border_color
ecl_class_background_color
The grey color used in typography case has been replaced with dark.
New patterns
- Highlighted list pattern (
highlighted_list
) - used for displaying a main highlighted item along with 3 secondary items placed on the right side of the page. All the items are using thelist_item
pattern's structure withdefault
. - Tabs pattern (
tabs
) - used mainly for navigation links. We are using this to render the Drupal local tasks.
Content display changes
All the teaser templates are using the vertical variant for displaying the lists.
Upgrade to 3.0.0
Page header pattern
ECL v3 adds the following features to the page header component:
- The possibility of displaying a thumbnail right next to the page description
- The possibility of adding a background image
- The possibility of adding an overlay on top of the background image, to compensate for poor text contrast
In order to accommodate these changes we have added the following optional fields to the "Page header" pattern:
thumbnail: type: "ImageValueObject" label: "Thumbnail" description: "Thumbnail displayed alongside the description." background_image_url: type: "array" label: "Background image URL" description: "Background image URL, only displayed when the theme ECL branding is set to 'Core'." overlay: type: "text" label: "Overlay" description: "Optional overlay on top of background image (can be 'light', 'dark'). Only used on EC sites"
We have also removed the following deprecated fields:
identity: type: "text" label: "Identity (deprecated)" description: "The site name. Deprecated from ECL 2.30." infos: type: "array" label: "Infos (deprecated)" description: "A list of infos of the current page. Deprecated from ECL 2.30."
In addition, the customization that allowed the content language switcher to be rendered inside the page header has been deprecated in favor of the new ECL composition. Instead, the OpenEuropa Content Language Switcher block provided by OpenEuropa Multilingual needs to be used in its place. Sites updating to OpenEuropa Theme V3 are advised to place this block in the page header region if they wish still need the functionality.
Content item compositions
We have removed the following compositions from our theme:
templates/compositions/ec-component-content-item/content-item-date.html.twig
templates/compositions/ec-component-content-item/content-item.html.twig
Consider using the List item pattern and its variants instead.
Text with Featured media pattern
The pattern Text with Featured media now supports the following 4 variants:
- Left simple /
left_simple
: text on the left, simple call to action. This is the default behaviour. - Right simple /
right_simple
: text on the right, simple call to action. - Left featured /
left_featured
: text on the left, featured call to action. - Right featured /
right_featured
: text on the right, featured call to action.
If no variant is set, then the pattern will be visualized using the default one. This guarantees backward compatibility.
Site header
ECL v3 supports the horizontal menu in both Core and Standardised branding. In order to accommodate this, we removed the
visibility condition of the Main navigation
block:
visibility: oe_theme_helper_current_branding: id: oe_theme_helper_current_branding branding: standardised negate: false context_mapping: { }
Upgrade to 2.17.0
Dropdown UI pattern
In 2.17.0 we dropped support for the Dropdown
pattern, which will be removed in the next major version.
The pattern is still available, albeit hidden on the pattern overview page. The new Dropdown
pattern is based on the
ECL Expandable component and should work as a drop-in replacement of the old one.
Upgrade to 2.15.0
Social media links pattern
In 2.15.0 we introduced a new pattern "Social media links" with two variants:
horizontal
: social media links will be arranged horizontally.vertical
: social media links will be arranged vertically.
Therefore patterns "Social media links: horizontal" and "Social media links: vertical" are now deprecated. Use the "Social media links" pattern with an appropriate variant instead.
Upgrade to 2.10.0
ECL page header
In 2.10.0 we dropped supporting the following elements in the "Page header" pattern:
identity
: used to show site-identifying information (such as the site name).infos
: used to show secondary meta information, below the page header introduction text.
As a result, if your PageHeaderMetadata
plugins provide such data, it will no longer be displayed.
ECL branding
In 2.10.0 we introduced support for ECL branding (read above for more information). The OpenEuropa Theme will use the "Core" branding, visit the theme configuration page if you need to change that and use the "Standardised" branding instead.
To know which branding your site is supposed to use check the ECL website.
Upgrade to 2.9.0
Content type teasers
If you are using the oe_content
module together with the OpenEuropa theme then updating to 2.9.0 or later will affect your
existing teaser displays. The 2.9.0 version updates the teaser display of most content types provided by oe_content
so if you want to keep any customization you have made to your site you will need to redo those modifications and
override the teaser templates on your own custom theme.
ECL site header
In 2.9.0 we dropped support for the legacy ECL site header. To do so we had to move the language switcher block to the
site_header_secondary
theme region. This means that:
- If your site does not use a sub-theme, then you have nothing to worry about, as we will move the block there for you in a post-update hook (if we find one)
- If your site does use a sub-them which displays the language switcher block, then you'll need to move it to the
site_header_secondary
region yourself
Upgrade from 1.x to 2.x
- The following patterns have been removed on 2.x:
dialog
file_link
- The
variant
field on thefield
pattern has been removed. Instead, ui_patterns variants definition is used. Read ui_patterns pattern definition documentation for how it works. - OpenEuropa Corporate Blocks 1.x is not supported anymore, you should use version 2.x instead.
Companion sub-modules
- OpenEuropa Theme Contact Forms
- OpenEuropa Content Call for tenders companion module
- OpenEuropa Content Corporate Entity Contact companion module
- OpenEuropa Content Corporate Entity Organisation companion module
- OpenEuropa Content Corporate Entity Venue companion module
- OpenEuropa Content Event companion module
- OpenEuropa Content News companion module
- OpenEuropa Content Page companion module
- OpenEuropa Content Policy companion module
- OpenEuropa Content Project companion module
- OpenEuropa Content Publication companion module
Corporate blocks
When using the theme in conjunction with the OpenEuropa Corporate Blocks component changing the component library will show a different footer block, namely:
- The European Commission footer, shipping with a set of links and references that must be present on all European Commission sites.
- The European Union footer, shipping with a set of links and references that must be present on all European Union sites.
Image styles
OpenEuropa Theme ships with a number of image styles that should help users follow the guidelines set by the ECL. The following is a list of all the vailable styles and their preferred usage:
- List item (
oe_theme_list_item
): To be used on content lists with small thumbnails. - Featured list item (
oe_theme_list_item_featured
): To be used on highlights and content lists with big thumbnails. - Medium (
oe_theme_medium_no_crop
): Medium sized image, part of the Main content responsive image style. - Small (
oe_theme_small_no_crop
): Small sized image, part of the Main content responsive image style. - Main content (
oe_theme_main_content
): Responsive image style, to be used on any image that is rendered inside a content page. - Full width (3840) (
oe_theme_full_width
): Full width image (3840px x 3840px).
Banner image styles for different ratios
- Full width banner 3:1 (
oe_theme_full_width_banner_3_1
) - Extra large banner 3:1 (
oe_theme_extra_large_3_1_banner
) - Large banner 3:1 (
oe_theme_large_3_1_banner
) - Medium banner 3:1 (
oe_theme_medium_3_1_banner
) - Small banner 3:1 (
oe_theme_small_3_1_banner
) - Full width banner 4:1 (
oe_theme_full_width_banner_4_1
) - Extra large banner 4:1 (
oe_theme_extra_large_4_1_banner
) - Large banner 4:1 (
oe_theme_large_4_1_banner
) - Medium banner 4:1 (
oe_theme_medium_4_1_banner
) - Small banner 4:1 (
oe_theme_small_4_1_banner
) - Full width banner 5:1 (
oe_theme_full_width_banner_5_1
) - Extra large banner 5:1 (
oe_theme_extra_large_5_1_banner
) - Large banner 5:1 (
oe_theme_large_5_1_banner
) - Medium banner 5:1 (
oe_theme_medium_5_1_banner
) - Small banner 5:1 (
oe_theme_small_5_1_banner
)
Development
The OpenEuropa Theme project contains all the necessary code and tools for an effective development process, meaning:
- All PHP development dependencies (Drupal core included) are required in composer.json
- All Node.js development dependencies are required in package.json
- Project setup and installation can be easily handled thanks to the integration with the Task Runner project.
- All system requirements are containerized using Docker Composer.
- Every change to the code base will be automatically tested using Drone.
Make sure you read the developer documentation before starting to use the theme in your projects.
Project setup
Developing the theme requires a local copy of ECL assets, including Twig templates, SASS and JavaScript source files.
In order to fetch the required code you'll need to have Node.js (>= 8) installed locally.
To install required Node.js dependencies run:
npm install
To build the final artifacts run:
npm run build
This will compile all SASS and JavaScript files into self-contained assets that are exposed as Drupal libraries.
In order to download all required PHP code run:
composer install
This will build a fully functional Drupal site in the ./build
directory that can be used to develop and showcase the
theme.
Before setting up and installing the site make sure to customize default configuration values by copying runner.yml.dist
to ./runner.yml
and override relevant properties.
To set up the project run:
./vendor/bin/run drupal:site-setup
This will:
- Symlink the theme in
./build/themes/custom/oe_theme
so that it's available to the target site - Setup Drush and Drupal's settings using values from
./runner.yml.dist
- Setup PHPUnit and Behat configuration files using values from
./runner.yml.dist
Please note: project files and directories are symlinked within the test site by using the OpenEuropa Task Runner's Drupal project symlink command.
If you add a new file or directory in the root of the project, you need to re-run drupal:site-setup
in order to make
sure they are be correctly symlinked.
If you don't want to re-run a full site setup for that, you can simply run:
$ ./vendor/bin/run drupal:symlink-project
After a successful setup install the site by running:
./vendor/bin/run drupal:site-install
This will:
- Install the target site
- Set the OpenEuropa Theme as the default theme
- Enable OpenEuropa Theme Demo and Configuration development modules
Using Docker Compose
Alternatively, you can build a development site using Docker and Docker Compose with the provided configuration.
Docker provides the necessary services and tools such as a web server and a database server to get the site running, regardless of your local host configuration.
Requirements:
Configuration
By default, Docker Compose reads two files, a docker-compose.yml
and an optional docker-compose.override.yml
file.
By convention, the docker-compose.yml
contains your base configuration and it's provided by default.
The override file, as its name implies, can contain configuration overrides for existing services or entirely new
services.
If a service is defined in both files, Docker Compose merges the configurations.
Find more information on Docker Compose extension mechanism on the official Docker Compose documentation.
Usage
To start, run:
docker-compose up
It's advised to not daemonize docker-compose
so you can turn it off (CTRL+C
) quickly when you're done working.
However, if you'd like to daemonize it, you have to add the flag -d
:
docker-compose up -d
Then:
docker-compose exec -u node node npm install docker-compose exec -u node node npm run build docker-compose exec web composer install docker-compose exec web ./vendor/bin/run drupal:site-install
Using default configuration, the development site files should be available in the build
directory and the development site
should be available at: http://127.0.0.1:8080/build.
Running the tests
To run the grumphp checks:
docker-compose exec web ./vendor/bin/grumphp run
To run the phpunit tests:
docker-compose exec web ./vendor/bin/phpunit
To run the behat tests:
docker-compose exec web ./vendor/bin/behat
Step debugging
To enable step debugging from the command line, pass the XDEBUG_SESSION
environment variable with any value to
the container:
docker-compose exec -e XDEBUG_SESSION=1 web <your command>
Please note that, starting from XDebug 3, a connection error message will be outputted in the console if the variable is set but your client is not listening for debugging connections. The error message will cause false negatives for PHPUnit tests.
To initiate step debugging from the browser, set the correct cookie using a browser extension or a bookmarklet like the ones generated at https://www.jetbrains.com/phpstorm/marklets/.
Disable Drupal 8 caching
Manually disabling Drupal 8 caching is a laborious process that is well described here.
Alternatively, you can use the following Drupal Console command to disable/enable Drupal 8 caching:
./vendor/bin/drupal site:mode dev # Disable all caches. ./vendor/bin/drupal site:mode prod # Enable all caches.
Note: to fully disable Twig caching the following additional manual steps are required:
- Open
./build/sites/default/services.yml
- Set the following parameters:
parameters: twig.config: debug: true auto_reload: true cache: false
- Rebuild Drupal cache:
./vendor/bin/drush cr
This is due to the following Drupal Console issue.
Working with ECL components
You can use the ECL components in your Twig templates by referencing them using the ECL Twig Loader as shown below:
{% include '@ecl-twig/logos' with { 'to': 'https://ec.europa.eu', 'title': 'European Commission', } %}
Important: not all ECL templates are available to the theme for include, whenever you need include a new ECL template
remember to add it to the copy
section of ecl-builder.config.js and run:
npm run build
Update ECL
To update ECL components change the @ec-europa/ecl-preset-full
version number in package.json and run:
npm install && npm run build
This will update assets such as images and fonts and re-compile CSS. Resulting changes are not meant to be committed to this repository.
Watching and re-compiling Sass and JS changes
To watch for Sass and JS file changes - /sass folder - in order to re-compile them to the destination folder:
npm run watch
Resulting changes are not meant to be committed to this repository.
Patching ECL components
ECL components can be patched by using the patch-package
NPM project.
To patch a component:
- Modify its source files directly in
./node_modules/@ecl/[component-name]
- Run:
npx patch-package @ecl-twig/[component-name]
Or, when using Docker Compose:
docker-compose exec -u node node git config --global user.email "name@example.com" docker-compose exec -u node node git config --global user.name "Name" docker-compose exec -u node node npx patch-package @ecl/[component-name]
Patches will be generated in ./patches
and applied when running npm install
.
Working with a development version of ECL
To build the theme using a development version of ECL run make ecl-dev
instead of the npm install
procedure described above, this will:
- Checkout a working copy of the ECL repository from the branch you indicate in
.env.dist
. - Build ECL using the above codebase.
- Copy Twig templates and CSS/JS assets where the theme expects them to be.
- Compile theme's SASS files using the ECL's dev version
If you want to create a release using a dev ECL version, make sure that ECL_BUILD
is set to dev
in .env.dist
.
You can then control which branch and repo ECL will be built from by setting ECL_BUILD_REF
and ECL_BUILD_REPO
in the same file.
Contributing
Please read the full documentation for details on our code of conduct, and the process for submitting pull requests to us.
Versioning
We use SemVer for versioning. For the available versions, see the tags on this repository.