Menu path in Pathauto

前端 未结 10 1131
天命终不由人
天命终不由人 2021-02-01 17:31

How do I get pathauto under Drupal 7 to generate a URL alias by the full menu path?

10条回答
  •  北荒
    北荒 (楼主)
    2021-02-01 17:47

    I ended up using:

    [node:menu-link:parent:url:path]/[node:menu-link]

    Heavy caution though: If the node does not have a menu link, you'll end up without an automatically aliased page. On the bright side, this might make you aware of orphan pages. (Consider it a feature!)

    Note that using the pattern:

    [node:menu-link:url:path]/[node:menu-link]

    will only give the node's menu link, not that of the parent (which would be needed to reference the parent's path).

    Or the pattern: [node:parent:url:path]/[node:menu-link]

    throws an error in my instance of Drupal 7 about invalid tokens (even though I have the token module installed).

提交回复
热议问题