Pathauto does not generate URLs for taxonomy terms

I created a list of term (all Elements known):
Actinium, Aluminium, Americium, Antimony, etc…

For each of them a number has been done, for Lithium the mumber is 219…
URL is https://isoldeop.web.cern.ch/taxonomy/term/219

instead of to have 219, I would like to have an URL alias
https://isoldeop.web.cern.ch/taxonomy/term/Lithium

in https://isoldeop.web.cern.ch/admin/config/search/path/patterns Edit Elements pattern
I put
Pattern type, Taxononomy term
Path pattern [term:vocabulary]/[term:name] ( I think is here the mistake)…

It doesn’t work… Could you help me?

Thank you in adavance

Cheers

Simon

Hello Simon,

Two things I can think of:

  • For the vocabulary you need to specify which field of the vocabulary should be rendered. By default Drupal does not know what should be rendered. As a result you should choose one of the fields mentioned under vocabulary (I guess in your case it should be the name). The [term:name] on the other hand is correct since you specify the field.

Screenshot 2020-04-08 at 17.33.42

  • After setting the pattern you should Bulk Generate the aliases based on the new pattern. Just navigate to the Bulk Generate tab (two tabs after Patterns) and choose to generate them.

Let me know if that works for you.

Konstantinos

Hi Konstantinos,

No it doesn’t work… I have always
https://isoldeop.web.cern.ch/taxonomy/term/219
https://isoldeop.web.cern.ch/taxonomy/term/222

in my Drupal 7, I was getting
http://isoldeop-d7.web.cern.ch/elements/lithium
http://isoldeop-d7.web.cern.ch/elements/carbon

Any other suggestion, please…

Thank you

Simon

Hello Simon,

I just checked your website and you have not applied the solution I mentioned in my previous comment.

Screenshot 2020-04-09 at 10.14.41

You should use [term:vocabulary:name], not [term:vocabulary] because in that case you do not specify the vocabulary field that you want to render.

Please apply it and let me know if it works.

Konstantinos

no, I tried but I got the message taht only 2 path are regenerated only… my path pattern doesn’t seem correct with [term:vocabulary:name]/[term:name]

Cheers

Simon

Hello Simon,

I cloned your website to test it better and I found what was wrong

If you visit the taxonomies you have created, you will notice that the option to “Generate automatic URL alias” is unchecked. Not sure if you unchecked it when you were created it or if it is the default but for sure this creates the issue. Just go over all the elements you created and check this option.

In that case you don’t need to Bulk generate the terms because the URL alias will be created when you hit “Save”. After saving the term, go back to the term and you will notice that the alias is applied.

Hope that helps.

Konstantinos

Bravo! It is working… Thank you very much. I will correct all my elements

Tank you

Simon