Can Pathauto fallback to another pattern if the first pattern yields an empty path? I want pages to have an auto generated path if they are in a menu and another one if they are not in the menu; not an empty path like Pathauto currently generates if the page is not in a menu.

How can I do that?

Details: I'm using this pattern for my pages content type which works perfectly when a page is in a menu.

[node:menu-link:parents:join-path]/[node:menu-link]


The problem is, when a page is not in a menu, it gets an empty path. I want to give it another path based on the "title" of the page, for example.
You can now achieve this using hook_pathauto_pattern_alter().  Something like:

&lt;?php
/**
 * Implements hook_pathauto_pattern_alter().
 */
function mymodule_pathauto_pattern_alter(&amp;$pattern, array $context) {
  // Alter any node entity path patterns we need to
  if (isset($context['data']['node'])) {
    $node = $context['data']['node'];

    switch ($node-&gt;type) {
      case 'page':
        // Check condition, and change the pattern when appropriate
        $pattern = '[node:title]';
        break;

    }
  }
?&gt;