There is a vocabulary like the one below and its term.
Vocabulary
World [Machine Name: world]
Taxonomy Terms
USA [URL Alias: usa]
└─ California [URL Alias: usa/california]
└─ Los Angeles [URL Alias: usa/california/losangeles]
And I would like to use the Pathauto module and make the URL of the losangeles term page as http://example.com/usa/california/losangeles.
In other words, the machine name of the vocabulary is taken as the root directory, And I want to make URLs synchronous with the hierarchical structure of terms belonging to that vocabulary a path lower than that. And I want to use tokens of Pathauto.
In that case, how can I set it in the Pathauto setting page(/admin/config/search/path/patterns)?
I tried many kinds of patterns, but it did not work. The version of Drupal is 7.52.
If you know the solution, please let me know. Thank you very much.
You should really look at the token suggestions that the patterns page give you. Under the taxonomy token you will find the parents token.
This is an array that has an other token again that lets you join them together.
Now you have the path ready made for you upto the term you are on, that one you will need to add yourself with term:name.
Giving you a path:
This will generate the correct path for you no mather how deep so
Usa which has no parents and the name usa will generate:
California has one parent named usa and is named California will generate
And the last one 2 parents named usa and california will be joined together into /usa/california and is named Los Angeles and will result into