{"id":13852337,"url":"https://github.com/aleksip/multiple_definition_files","last_synced_at":"2025-07-13T04:30:55.294Z","repository":{"id":161592370,"uuid":"157542465","full_name":"aleksip/multiple_definition_files","owner":"aleksip","description":"Development and issues now at drupal.org","archived":true,"fork":false,"pushed_at":"2018-11-24T15:56:50.000Z","size":16,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"8.x-1.x","last_synced_at":"2024-08-05T22:39:19.197Z","etag":null,"topics":["drupal","drupal-8","drupal-module"],"latest_commit_sha":null,"homepage":"https://www.drupal.org/project/multiple_definition_files","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aleksip.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2018-11-14T12:01:32.000Z","updated_at":"2023-01-28T18:07:47.000Z","dependencies_parsed_at":"2024-01-18T11:02:23.204Z","dependency_job_id":"423a7da4-db19-4ede-b3fa-c07c5bc9cab6","html_url":"https://github.com/aleksip/multiple_definition_files","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aleksip%2Fmultiple_definition_files","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aleksip%2Fmultiple_definition_files/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aleksip%2Fmultiple_definition_files/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aleksip%2Fmultiple_definition_files/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aleksip","download_url":"https://codeload.github.com/aleksip/multiple_definition_files/tar.gz/refs/heads/8.x-1.x","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225855949,"owners_count":17534963,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["drupal","drupal-8","drupal-module"],"created_at":"2024-08-04T22:01:15.976Z","updated_at":"2024-11-22T06:31:32.367Z","avatar_url":"https://github.com/aleksip.png","language":"PHP","funding_links":[],"categories":["PHP"],"sub_categories":[],"readme":"# Multiple Definition Files\n\nThis Drupal 8 module enables multiple definition files for theme [asset libraries](https://www.drupal.org/docs/8/theming/adding-stylesheets-css-and-javascript-js-to-a-drupal-8-theme) and [layouts](https://www.drupal.org/docs/8/api/layout-api/how-to-register-layouts).\n\n\n## Installing\n\nInstall and enable just like any other Drupal module. No configuration required.\n\n\n## Motivation\n\nOne of the principles in Twig component based theme development is that all files related to a particular component should be located in a component specific folder. However, currently Drupal core only supports extension (theme) specific definition files for asset libraries and templates. This module enables component specific definition files to be located in component folders.\n\n\n## How it works\n\nThe theme folder of the default theme is recursively scanned for definition files. All found definitions are then merged into the existing/a new main theme definition file using [`hook_library_info_alter()`](https://api.drupal.org/api/drupal/core!lib!Drupal!Core!Render!theme.api.php/function/hook_library_info_alter) and [`hook_layout_alter()`](https://api.drupal.org/api/drupal/core!core.api.php/function/hook_layout_alter). From the perspective of Drupal core, everything should work just the same as if all definitions were in the main theme specific file.\n\n\n## Notes on layout templates\n\nPlease note that the templates defined in `.layout.yml` files should use the `.html.twig` suffix.\n\nThe contents of regions defined in `.layout.yml` files are by default accessible in Twig templates under the `content` variable. So the contents of a `main` region would be displayed with `{{ content.main }}`. To aid in creating less Drupal specific component templates, this module also makes layout region variables available in the Twig context root. This makes it also possible to use just `{{ main }}`. The module will not overwrite existing variables. This means that defining a `content` region should probably be avoided, as that would have to be displayed with `{{ content.content }}`.\n\n\n## Warning\n\nThis is an experimental module. The approach used might not be a good one, and might cause unforeseen issues. Use at your own risk.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faleksip%2Fmultiple_definition_files","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faleksip%2Fmultiple_definition_files","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faleksip%2Fmultiple_definition_files/lists"}