Menu path in Pathauto

前端 未结 10 1137
天命终不由人
天命终不由人 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:43

    If you're attempting to make aliases for pages that are 3rd level or deeper, for example:

    Home page
     > Level 1 page
       > Level 2 page
         > Level 3 page
    

    and you want the alias for Level 3 page to look like http://domain.com/level-1/level-2/level-3, I got it to work for me by setting my pattern to:

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

    Notice that I added :parent to the token, and for the first one I added it twice.

提交回复
热议问题