By Francisco Luz

2013-06-11 21:23:20 8 Comments


  1. I created taxonomy terms with 3 depth levels. Example:

    Term 1 ( Root )
       Term 2 ( Child of Root )
          Term 3 ( Child of Term 2 )
  2. In the URL Alias for my vocabulary I set:

    That successfully creates a path that looks like this:
    "" for the root term
    "" for the root's child term
    "" for the child's child term
  3. In my Content Type, I created a Term Reference field that forces the user to select the deepest term ( 3rd term down ) with the help of Simple hierarchical select module.


When creating nodes, I would like to set the node's URL Alias to term-1/term-2/term-3/node-tile. I am having trouble finding the Replacement Pattern for doing just that.

Does path auto allow me to do that out of the box? If so, what pattern should I use?


@Елин Й. 2013-06-11 21:39:40

Yes there is a token for that. Assuming the machine name of the Term Reference field in your content type is field_myterm, the pattern for the path should be:


Notice the underscore in the field name is replaced with a dash in the token.

Edit: I just realized that these tokens come with Entity Tokens module which is included in Entity API module.

@Francisco Luz 2013-06-11 23:26:28

Thank you Елин Й. Both solutions, yours and Clive's, work as gold.

@Clive 2013-06-11 21:40:14

There are some advanced uses of tokens (not sure off the top of my head if that's just in the context of pathauto or not). You can get what you're looking for with join:


You could also replace your term pattern with:


Using that method your vocabulary can grow gracefully to 4 (or more) levels without having to change the pathauto pattern.

You'll need to go to admin/config/search/path/settings and set the Slash (/) option to "Do not Replace" under "Punctuation" for that method to work.

@Francisco Luz 2013-06-11 22:53:56

Ok, I am still having trouble. Please take a look at this screen shot here . It shows the available tokens for my taxonomy field under "Content Paths". Notice that tokens like [node:field-main-menu:parents... and [node:field-main-menu:name] is not available and sure enough drupal complains about it when I try to save. Non of those tokens seen on the screen shot actually work but [node:field-main-menu] which returns the deepest term item ( Term 3 ). Would you have a clue of what might bee the issue here?

@Clive 2013-06-11 23:15:04

Do you have the Entity API module installed? As @Елин Й. mentioned that's required, I forgot to add that

@Francisco Luz 2013-06-11 23:25:09

Yes I do have Entity API. I've just figured out what was wrong. My field was set to unlimited values. Now both solutions, yours and @Елин Й work beautifully. Thank you very much both of you.

Related Questions

Sponsored Content

1 Answered Questions

How to get taxonomy tree with path auto token?

3 Answered Questions

Show 404 on page for node path url instead of redirecting to it's alias

1 Answered Questions

[SOLVED] How do I modify the URL to a taxonomy term?

1 Answered Questions

Where in the MySQL database schema is the URL alias for a group relation?

1 Answered Questions

How to set alias pattern of node's source alias?

1 Answered Questions

[SOLVED] Tokens for taxonomy term parents in Pathauto

  • 2017-01-05 00:27:37
  • Scott Anderson
  • 2778 View
  • 3 Score
  • 1 Answer
  • Tags:   8 path-aliases

2 Answered Questions

How to set the url alias of a node created by Rules?

1 Answered Questions

[SOLVED] Create custom path alias when new user is added in drupal 7

  • 2015-08-19 06:14:30
  • Guru
  • 381 View
  • 0 Score
  • 1 Answer
  • Tags:   path-aliases

1 Answered Questions

taxonomy auto-path views path issue

Sponsored Content