I'm working on a drupal 8 project, I need to access the content type X nodes via two aliases depending on some conditions, for this I've created two Pathauto patterns using Pathauto contrib module:
path_1 --> /local/[node:title]
path_2 --> /global/[node:title]
path_1 & path_2 are supposed the machine name of those two patterns.
What are those two patterns? actually what I want to do is check if a node of type X has the checkbox field 'global' checked so use /global/[node:title]
as alias for this node else use /local/[node:title]
.
Which hook should I implements for selecting/altering a pathauto pattern for a node? And can I use those aliases as a route for a controller?