I seem to have stumbled across a problem, I don't know if its an error on my part or if its just the module, hopefully someone may be able to shed some light on my issue.
I have setup pathauto to generate aliases for my pages, I have used the following pattern for my page content type
[menupath-raw]
which works well and generates the alias if the page is in a menu, and for second-level menu items etc which most of my pages are.
My problem is if i create a page (same content type) and it doesn't belong to a menu, an alias cant be created so i am stuck with a page with no alias.
Any suggestions?
Comments
Comment #1
jami3z commentedNo help?
Comment #2
FlemmingLeer commentedHow many menus do you have ?
Comment #3
Frank Steiner commentedThis is normal behaviour: If you tell pathauto "create an alias from the menu path" and then you create a page without a menu, what kind of alias do you expect to get???
Comment #4
gregglesThanks for the answer, Frank Steiner.
Comment #6
jami3z commentedSorry, but I have been away and unable to check up on this. I understand what the pathauto is doing, thats not my issue. I probably should have explained it a little better.
In the settings for pathauto, under "Node Path Settings" I currently have [menupath-raw] for all page paths, this because I need aliases created for when a menu item is added to a parent item so I get the alias like http://domainname.com/parent-item/menu-item
but, as the above setting is in use for all page paths, when a normal page node is created, which does not belong to any menu etc, it is stuck at being http://domainname.com/node-id.
So I need to be able to set it up somehow so that when a page node is created and added to a menu or submenu the url path is generated, and also be able to generate an alias for a node that isnt associated with a menu etc.
Any help would be great, this is driving me nuts.
Comment #7
Frank Steiner commentedThat would be a conditional pattern, discussed sometimes before, but hard to implement I guess.
I'm not sure, but can't you chose the menupath without the last element? I though there was such an option, I can't take a look at the moment.
And then add the page title? Assuming that the page and menu title are somehow similar, you would always get a alias, either the pagetitle alone or with the menu path below.
Comment #8
chriscalip commentedSure would be nice to have the option [menupath-raw-or-title-raw]
If menupath doesnt exist then provide title-raw instead token.
Prolly with custom tokens?
Comment #9
gregglesYes, prolly so.
There are so many "it would be nice to have X token" but the generation of all these Tokens is bad for site performance.
See the Token Starter Kit for details on how to do it if you are not sure.