Drupal 7:Pathauto patterns from menu structure hierarchy
Asked Answered
D

5

5

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 menu hierarchy.

I've tried many different variations, and nothing works. I've tried the suggestions in Menu path in Pathauto, and none of them works at all. It just ends up outputting the node-title, with nothing before it.

I've got the latest versions of the Token and Pathauto modules installed.

Debut answered 24/10, 2011 at 11:16 Comment(1)
Write your own token. For the same issue we wrote a token that gets all the parent paths.Distract
D
7

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!

Debut answered 19/2, 2013 at 12:29 Comment(0)
H
2

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.

Heck answered 22/11, 2011 at 21:18 Comment(1)
8 months later, but neither these versions nor the most recent ones fix this problem. Also, [node:menu-link:parent:url:alias] is always invalid for me (not showing up in the list of valid tokens). Are you sure these are the only two required modules?Peanuts
S
2

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

Streptokinase answered 5/3, 2014 at 5:23 Comment(0)
E
2

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).

Earmuff answered 15/4, 2014 at 14:45 Comment(0)
A
0

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

Ashtonashtonunderlyne answered 17/2, 2013 at 16:26 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.