{"id":13652048,"url":"https://github.com/pmelab/contextual_aliases","last_synced_at":"2025-07-14T14:32:29.901Z","repository":{"id":81113373,"uuid":"105999132","full_name":"pmelab/contextual_aliases","owner":"pmelab","description":"Drupal module to enable the same alias in different contexts.","archived":false,"fork":false,"pushed_at":"2019-08-28T06:31:47.000Z","size":38,"stargazers_count":11,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-11-10T03:32:54.911Z","etag":null,"topics":["drupal","drupal-8"],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pmelab.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-10-06T11:54:06.000Z","updated_at":"2022-08-01T23:05:44.000Z","dependencies_parsed_at":null,"dependency_job_id":"6a62ab07-659f-4078-a85d-13522b6d4a0e","html_url":"https://github.com/pmelab/contextual_aliases","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pmelab%2Fcontextual_aliases","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pmelab%2Fcontextual_aliases/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pmelab%2Fcontextual_aliases/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pmelab%2Fcontextual_aliases/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pmelab","download_url":"https://codeload.github.com/pmelab/contextual_aliases/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225980848,"owners_count":17554920,"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"],"created_at":"2024-08-02T02:00:54.774Z","updated_at":"2024-11-22T23:46:20.453Z","avatar_url":"https://github.com/pmelab.png","language":"PHP","funding_links":[],"categories":["Drupal"],"sub_categories":["Drupal modules"],"readme":"# Contextual aliases\n\nThis module allows to split Drupal's url aliases into different contexts that allow to use the *same* alias for\n*different* source paths. The most prominent use case is a setup with different domains, where the same path is\nsupposed to point to a different node, depending on the current domain.\n\n```\nhttp://a.com/imprint -\u003e /node/1\nhttp://b.com/imprint -\u003e /node/2\nhttp://c.com/imprint -\u003e /node/3\n```\n\n**Disclaimer:** This is an advanced module that requires coding and knowledge about cache configuration.\n\n## How it works\n\nWhen saving a new alias, the module will search for services tagged with `alias_context_resolver` that implement the\n`AliasContextResolverInterface`, and use them to determine the context for a given path.\n\n```\n/node/1 -\u003e a\n/node/2 -\u003e b\n/node/3 -\u003e NULL\n```\n\nIt will store this path and use it for resolving paths from aliases and vice versa. There it will consult the context\nresolver again to obtain the *current* context (e.g. the domain the request was sent to). If the result matches the\nstored context for this alias, it will behave normal. If not, aliases will prefixed (both ways) with their context.\nNon-contextual aliases remain functional, but will be picked with a lower priority.\n\n### Current context: none\n```\n/node/1 -\u003e /a/imprint\n/node/2 -\u003e /b/imprint\n/node/3 -\u003e /imprint\n\n/imprint -\u003e /node/3\n```\n\n### Current context: 'a'\n```\n/node/1 -\u003e /imprint\n/node/2 -\u003e /b/imprint\n/node/3 -\u003e /imprint\n\n/imprint -\u003e /node/1\n```\n\n### Current context: 'b'\n```\ncurrent context: b\n\n/node/1 -\u003e /a/imprint\n/node/2 -\u003e /imprint\n/node/3 -\u003e /imprint\n\n/imprint -\u003e /node/2\n```\n\n## How to use it\nThe module requires you to implement your own context resolvers and add them as services tagged with\n`alias_context_resolver` and (more importantly) configure caching in a way it also respects the same contextual\ninformation. Otherwise you will have a very bad time watching your page cache serving random pages.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpmelab%2Fcontextual_aliases","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpmelab%2Fcontextual_aliases","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpmelab%2Fcontextual_aliases/lists"}