I'm filling this because I'm facing the same problem as described in #375467: Pathauto generating alias problem but did not want to re-open such an old issue.

How about we allowed multiple patterns to be defined for fallback purposes? So in the case above we could have a menu-depended pattern like [node:menu-link:parents:join-path]/[node:menu-link] and if that generated no path (when the node was not assigned to a menu for example), then fallback to content/[node:title].

This could be entered like so (using "|" as a separator for the two patterns):

[node:menu-link:parents:join-path]/[node:menu-link]|content/[node:title]

or like so (using a comma instead):

[node:menu-link:parents:join-path]/[node:menu-link],content/[node:title]

Comments

klonos’s picture

Title:Allow alternative patterns to be defined (separated by commas or '|' perhaps?).» Allow alternative/fallback patterns to be defined (separated by commas or '|' perhaps?).

...

klonos’s picture

Title:Allow alternative/fallback patterns to be defined (separated by commas or '|' perhaps?).» Allow alternative pattern(s) to be defined so they can be used as a fallback (when no alias is generated by the main pattern).

...I would love to get some feedback on this. Do you find my idea for this feature useful? Do you think that this is an edge case or a legit request?