I've noticed that the persistent state module seems to change the way that Pathauto generates aliases. Here are the two settings I've tried for my content path:
[node:menu-link:parents:join-path]/[node:title]
[node:menu-link:parent:url:path]/[node:title]
With the persistent state module, Pathauto is generating the alias from the parent menu title instead of the parent menu path.
If I have a website with a main section titled "About Us". If I allow Pathauto to generate the URL, it will create "domain.com/about-us". If I want to simplify that URL to something like "domain.com/about", I can uncheck the automatic alias box and enter my own path. All pages under the "About Us" page in the menu should have that same base URL. So if I have a "Staff" page under the "About Us" section, it's URL should be "domain.com/about/staff".
This would work before using the persistent state module, but the automatic alias box for all pages under the "About Us" section would become unchecked. I would then have to go through and re-check the box for each page.
Doing the same thing using the persistent state module, all the sub-pages keep their automatic alias box checked, but the URL stays the same. This seems to be because the alias is being generated from the parent title instead of the parent alias. So URL for my "Staff" page under the "About Us" section remains "domain.com/about-us/staff" while the parent page is "domain.com/about".
Comments
Comment #1
interX CreditAttribution: interX commentedThis is not an issue with Pathauto persistent state, but pathauto itself.
The only thing that the token [join-path] will do is use a cleaned version of the titles as path (regardless of parents' aliases)
This will not give the expected results if any of the parents has a fixed path alias or is not using [node:title] as URL alias.
There should be an additional token f.e. 'join-path-alias' to do this.
Comment #2
maxocub CreditAttribution: maxocub commentedHere is one way to do it:
Comment #3
Dave ReidI believe you want the [node:menu-link:parent:url:path] you mentioned in the above you used it, but that it only used the menu title. If that's not the case when using that token, then it's a bug in Token module's implementation.
Comment #4
maxocub CreditAttribution: maxocub commentedThank you Dave, you're right, it does exactly what I want!
Comment #5
Dave Reid