0

I have a taxonomy vocabulary which will only ever contain 2 level deep hierarchy.

I need the url to be just [vocabulary]/[term] for any parent term.

But for a child term I need it to be the following

[vocabulary]/[parent_term]/[term]

Is this possible with a pathauto token? If not, is there another solution to this?

1

You can use pathauto token like this.

 [term:vocabulary]/[term:parents:join-path]/[term:name]

enter image description here

  • Thanks, what will happen if the parent does not exist? – user43161 Nov 16 '16 at 9:40
  • If parent does not exist then vocabulary/term name – Pankaj Yogi Nov 16 '16 at 9:51
  • 1
    You missed a "/" above – user43161 Nov 16 '16 at 11:20
  • Sorry But I added screenshot. – Pankaj Yogi Nov 16 '16 at 11:24
  • I just wanted to say because for future people might get confused. Thanks – user43161 Nov 16 '16 at 12:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy