0

I want to be able to add articles to my Drupal 7 website where the URL location is automatically generated based on the taxonomy. Therefore, if I choose the taxonomy "News > Local > Town", it will be placed on my site at www.site.com/news/local/town.

So far, I have my taxonomy vocabulary hierarchy created. I installed Pathauto and Entity Reference. I don't know what to do from here.

When I go to the Pathauto "Configure" panel in my modules, I have three sets of paths: Content paths, Taxonomy term paths, User paths.

Under Content Paths, I believe I'm supposed to add something under Pattern for All Article Paths. I think what I'm supposed to add here are the variables to make a URL from the taxonomy.

So I researched. Exhaustively. I searched around for the last week. It seems to be a general consensus that I'm supposed to use the following line:

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

This is a problem. I get an error:

The Pattern for all Article paths is using the following invalid tokens [term:parents:join-path], [term:name].

Ok, that makes sense. The "term" token doesn't show up in my list under Content Paths. It does under Taxonomy Term Paths, but I'm trying to define my URL for my articles.

People are stuck. So am I. I'm burned out. This should be default Drupal functionality. I don't know why this is so difficult. I'm starting to change my favorable opinion of this software based on the amount of work I have to do to do things which come standard in every other CMS I've used.

Am I doing something wrong? Is there another step I need to take?

If anyone has ANY advice for me which can help us solve this problem, I would appreciate it!

apaderno
  • 28,547
  • 16
  • 75
  • 90
Brendan
  • 107
  • 2
  • 13
  • 1
    Have you seen this? It seems like what you are looking for: http://drupal.stackexchange.com/questions/28154/pathauto-url-of-term-for-node – kimberly Nov 15 '16 at 18:04
  • Or you can do it manually from code. Register your hook function when node is saved, check selected taxonomy and set node alias on your own:http://drupal.stackexchange.com/questions/13170/create-path-alias-programatically-when-node-is-created – MilanG Nov 16 '16 at 08:46
  • @kimberly, Yes, I have seen that. It is helpful, but doesn't quite get me to where I need to be. I was able to do a little with it, but something's not right. It doesn't like the tokens. I try different tokens and it still doesn't report it quite correctly. What is going on?? Is there something not installed on my site that should be? – Brendan Nov 16 '16 at 19:25
  • @MilanG, I may consider doing that, but I have no idea where to begin. I've only been using Drupal for a few weeks. I don't know what a hook is, how or why I'd register one, or how to check my taxonomy or set it as a node alias. I would definitely try that, as it seems it would work if I did it. However, what I'm trying to do is make my site work like almost every other site out there. It's perplexing that I'd have to go through so much work to do this, so I think I might be heading down the wrong path. – Brendan Nov 16 '16 at 19:27
  • Well, you have to learn a bit then. First you should create your module. Then inside that module you should have hook function - if you follow specific naming convention your function will be detected and automatically called by drupal and inside function body you can do your magic - change something, do something..That's how Drupal works. – MilanG Nov 17 '16 at 15:09

0 Answers0