Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/wieni/wmpathauto
Dynamic path aliases, pathauto patterns & automatic updating of aliases
https://github.com/wieni/wmpathauto
drupal-8 drupal-module drupal8-module path-alias pathauto pathauto-patterns
Last synced: 2 days ago
JSON representation
Dynamic path aliases, pathauto patterns & automatic updating of aliases
- Host: GitHub
- URL: https://github.com/wieni/wmpathauto
- Owner: wieni
- License: mit
- Created: 2020-01-23T13:19:43.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2023-12-18T05:36:44.000Z (about 1 year ago)
- Last Synced: 2024-12-08T02:24:28.877Z (21 days ago)
- Topics: drupal-8, drupal-module, drupal8-module, path-alias, pathauto, pathauto-patterns
- Language: PHP
- Size: 139 KB
- Stars: 0
- Watchers: 8
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
wmpathauto
======================[![Latest Stable Version](https://poser.pugx.org/wieni/wmpathauto/v/stable)](https://packagist.org/packages/wieni/wmpathauto)
[![Total Downloads](https://poser.pugx.org/wieni/wmpathauto/downloads)](https://packagist.org/packages/wieni/wmpathauto)
[![License](https://poser.pugx.org/wieni/wmpathauto/license)](https://packagist.org/packages/wieni/wmpathauto)> Dynamic path aliases, pathauto patterns & automatic updating of
> aliases## Why?
- **Create dynamic path aliases and pathauto patterns**, for the cases
where tokens are too limited
- **Automatically update an entity alias** when other entities that were
used to build this alias are updated## Installation
This package requires PHP 7.1 and Drupal 8 or higher. It can be
installed using Composer:```bash
composer require wieni/wmpathauto
```## How does it work?
### Dynamic path aliases
Sometimes when defining pathauto patterns, you'll notice the token
system is just too limited. This module supports building patterns and
aliases in code using plugins with annotations, respectively
`@AliasBuilder` and `@PatternBuilder`.### Dependencies
When updating an entity with a path alias, all entities, configs and
other path aliases that were used to build that alias are stored in the
database. In the future, when one of those path aliases, entities or
configs are updated, the path alias that depends on them will be
automatically regenerated.There are multiple ways to define dependencies:
### Automatic dependencies with tokens
When your pathauto pattern uses supported tokens, dependencies will be
automatically added based on those tokens. For example, if your pattern
contains the `[site:name]` token, the aliases using this pattern will be
regenerated when the site name is changed.Support for more token types can be added by creating plugins with the
`@PatternTokenDependencyProvider` annotation, defining the token type in the
`type` parameter and implementing the
[`PatternTokenDependencyProviderInterface`](src/PatternTokenDependencyProviderInterface.php) interface.### Manual dependencies using plugins
Dependencies can also be added manually by creating plugins with the
`@EntityAliasDependencyProvider` annotation, implementing the
[`EntityAliasDependencyProviderInterface`](src/EntityAliasDependencyProviderInterface.php) interface. Plugins with `AliasBuilder` or
`PatternBuilder` annotations implementing the same interface are also
considered.## Changelog
All notable changes to this project will be documented in the
[CHANGELOG](CHANGELOG.md) file.## Security
If you discover any security-related issues, please email
[[email protected]](mailto:[email protected]) instead of using the issue
tracker.## License
Distributed under the MIT License. See the [LICENSE](LICENSE) file
for more information.