Drupal 7:Pathauto patterns from menu structure hierarchy

前端 未结 5 585
囚心锁ツ
囚心锁ツ 2021-02-10 03:15

I\'m trying to create a Pathauto pattern which looks like \"Drupal root/parent_menu_item_name/node_title\" where \"node_title\" is a child of \"parent_menu_item_name\" in the me

相关标签:
5条回答
  • 2021-02-10 03:19

    This token uses the menu titles of each parent item to build a url:

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

    So if you have nested content titled: The Future -> Doc Brown -> Flux Capacitor

    The above token will print out:

    /the-future/doc-brown/flux-capacitor

    0 讨论(0)
  • 2021-02-10 03:29

    This works for me (for book type nodes): [node:menu-link:parent:title]/[node:title]

    Found on: http://www.metachunk.com/blog/drupal-7-path-auto-menu-pattern

    0 讨论(0)
  • 2021-02-10 03:36

    The token combination [node:menu-link:parent:url:alias]/[node:menu-link] shall work with the following modules :

    • token : 7.x-1.0-beta3
    • pathauto: 7.x-1.0-rc2

    The token patterns seem to vary depending on the version of the token module.

    0 讨论(0)
  • 2021-02-10 03:36

    This combination works perfectly for me

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

    with the latest token (7.x-1.5) and pathauto (7.x-1.2).

    0 讨论(0)
  • 2021-02-10 03:38

    I believe this question has been answered by Kenan:

    Kenan's answer

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

    It works for me, so I'm very happy!

    0 讨论(0)
提交回复
热议问题