Hi everyone,

I'm trying to use [node:book:parent:url:path]/[node:title] for setting up the URLs in a complex book hierarchy. In the ideal case this would leave me with URLs reflecting the whole book hierarchy structure. I would like to use the path of the parent node instead of the name etc. because my client required that he should be able to override some paths (for example we have a node with the title "documentation", he would like to use "docs" instead).

My problem shows up only for several pages (like 20 out of 400+?). It seems that at the time of the alias generation, sometimes [node:book:parent:url:path] is not available yet in an aliased form, so I end up having something like node/1250/random-title as the new alias.

Is there any better way of doing this?

CommentFileSizeAuthor
#2 taxonomy-tree-err.jpg33.13 KBjoseph11

Comments

scorchio’s picture

Title: Using [node:book:parent:url:path] as a part of the pattern leaves some part of the new alias un-aliased » Using [node:book:parent:url:path] as a part of the pattern leaves part of the new alias un-aliased
joseph11’s picture

StatusFileSize
new33.13 KB

I have similar problem and I believe that it has to do something with [term:parent:url:path] token.

My situation:

I'm using token combination [term:parent:url:path]/[term:name] to generate tree-like taxonomy term path. Works ALMOST as expected.
The problem is occurring when some term is 2 or more levels deep in structure - then it generates un-aliased path for second level term, BUT continues to generate aliased paths for following levels.

I'm attaching screenshot that might be more helpful than my description.

Thank you in advance.

dave reid’s picture

Component: Bulk generation » Code
dave reid’s picture

Issue summary: View changes

Finished the issue description, oops...

bohemier’s picture

Issue summary: View changes
Status: Active » Closed (works as designed)

The way I solve this is by using admin views, updating the node admin view by adding a bulk operation field and checking Update Node Alias in the operations. Then I add a Book Depth field so I can sort items. Save your view then open it at admin/content. Sort items by Book Depth, select all items and execute Update Node Alias. This will generate url aliases by depth, updating parents before children.

Since this is indended for manual operations, I am making this as closed(works as designed). You are welcome to reopen it is this is not the case.