3

I've trying to setup a Drupal 7 site where I already have some content added. The content is bound to a multi-level menu, but the path's for nodes in the submenus show only the actual node's alias, omitting the parent nodes. I wish to have url's where the path contains the content structure, no matter how many levels are?

I have tried a few pathauto settings:

  • [node:menu-link:parents:join-path]/[node:title]
  • [node:menu-link:parent:url:path]

After each try, I have rebuilt the paths and cleared cache, but I am still not getting the paths that I need, and they haven't actually changed. All of my nodes have the "Generate automatic URL alias" setting checked on the node edit page.

How can this be achieved?

3
  • btw, I could enter anything there manually? like with /(slashes) and stuff. I thought there should be some black magic applied to the path so it would look for all branches in the menu tree and join them together
    – Ashnur
    Nov 15, 2012 at 2:18
  • I integrated our comments into the original question; edit if anything is incorrect.
    – mpdonadio
    Nov 15, 2012 at 2:27
  • Thanks for the edit. I really should have known what pathauto is, but I've got this drupal install already configured, and I am not sure what features are from what modules and what modules are included in this setting. (there are too many with really too many features)
    – Ashnur
    Nov 15, 2012 at 2:31

2 Answers 2

1

I would try the following.

Take a backup of the database. Backup and Migrate makes this easy.

Make sure core and modules are up to date, especially Pathauto and Token.

Browse to admin/config/search/path/patterns, and set the path pattern to [node:menu-link:parents:join-path]/[node:menu-link]. Credit to Menu path in Pathauto.

Browse to admin/config/search/path and delete the bad aliases, or admin/config/search/path/delete_bulk and just delete all the content aliases. Be careful here, and make sure you have a backup.

Spot check a few nodes, and make sure the "Generate automatic URL alias" is set.

Double check that the nodes have a menu entry set on the node edit page, and that the parent is correct.

Double check the menus and make sure that the links have the paths set to node/XXX. You need to click the EDIT link to see this.

Browse to admin/config/search/path/update_bulk to create all of the aliases for the existing nodes.

Clear Drupal cache from admin/config/development/performance

That should work.

3
  • Thank you, this really worked as I imagined. Is the deletion of previos aliases always necessary?
    – Ashnur
    Nov 15, 2012 at 2:51
  • Yes, it usually is. Old aliases are kept around by default in case they get out into the wild. This prevents 404s when someone uses the old URL to access a n aliased page.
    – mpdonadio
    Nov 15, 2012 at 20:43
  • Path pattern is using the following invalid tokens: [node:menu-link:parents:join-path]. Jun 11, 2020 at 20:42
0

you can change the url path to the other site by going to Structure,menus,under main menu--click list of links. .click the edit and click the page u want to change the url and lastly put it in PATH and done..

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.