By tomas.teicher on
Hi,
how can I create aliases for book pages?
I want create aliases as follows:
mywebsite.com/book-title/page-parent1/page-parent2/page-title
I cannot find any tokens to achieve this. Is it possible in D7?
Hi,
how can I create aliases for book pages?
I want create aliases as follows:
mywebsite.com/book-title/page-parent1/page-parent2/page-title
I cannot find any tokens to achieve this. Is it possible in D7?
Comments
Same request
Hi,
I have the same problem.
So, if someone had an solution, it would be great !
I already tried Node Hierarchy, but it's redundant with the main goal of Book which is... hierarchizing.
Thanks in advance !
Luckly, there is an answer ;-)
In D7, when you're on the page to edit the URL Aliases (assuming you have pathauto enabled, it is: "Home » Administration » Configuration » Search and metadata » URL aliases" ), you will need to click the "replacement patterns" item in each section, which will list the tokens.
Here is a snip from my drupal site (note I didn't expand all the tokens ;):
Book [node:book] The book page associated with the node.
Edit URL [node:book:edit-url] The URL of the menu link's edit page.
Link ID [node:book:mlid] The unique ID of the menu link.
Menu [node:book:menu] The menu of the menu link.
Description [node:book:menu:description] The optional description of the menu.
Edit URL [node:book:menu:edit-url] The URL of the menu's edit page.
Machine-readable name [node:book:menu:machine-name] The unique machine-readable name of the menu.
Menu link count [node:book:menu:menu-link-count] The number of menu links belonging to the menu.
Name [node:book:menu:name] The name of the menu.
Parent [node:book:parent] The menu link's parent.
Edit URL [node:book:parent:edit-url] The URL of the menu link's edit page.
Link ID [node:book:parent:mlid] The unique ID of the menu link.
Menu [node:book:parent:menu] The menu of the menu link.
Parent [node:book:parent:parent] The menu link's parent.
Edit URL [node:book:parent:parent:edit-url] The URL of the menu link's edit page.
Link ID [node:book:parent:parent:mlid] The unique ID of the menu link.
Menu [node:book:parent:parent:menu] The menu of the menu link.
Parent [node:book:parent:parent:parent] The menu link's parent.
Root [node:book:parent:parent:root] The menu link's root.
Title [node:book:parent:parent:title] The title of the menu link.
URL [node:book:parent:parent:url] The URL of the menu link.
Root [node:book:parent:root] The menu link's root.
Edit URL [node:book:parent:root:edit-url] The URL of the menu link's edit page.
Link ID [node:book:parent:root:mlid] The unique ID of the menu link.
Menu [node:book:parent:root:menu] The menu of the menu link.
Parent [node:book:parent:root:parent] The menu link's parent.
Root [node:book:parent:root:root] The menu link's root.
Title [node:book:parent:root:title] The title of the menu link.
URL [node:book:parent:root:url] The URL of the menu link.
Title [node:book:parent:title] The title of the menu link.
URL [node:book:parent:url] The URL of the menu link.
Absolute URL [node:book:parent:url:absolute] The absolute URL.
Alias [node:book:parent:url:alias] The alias of the URL.
Internal path [node:book:parent:url:path] The internal Drupal path of the URL.
Relative URL [node:book:parent:url:relative] The relative URL.
Root [node:book:root] The menu link's root.
Edit URL [node:book:root:edit-url] The URL of the menu link's edit page.
Link ID [node:book:root:mlid] The unique ID of the menu link.
Menu [node:book:root:menu] The menu of the menu link.
Parent [node:book:root:parent] The menu link's parent.
Root [node:book:root:root] The menu link's root.
Title [node:book:root:title] The title of the menu link.
URL [node:book:root:url] The URL of the menu link.
Title [node:book:title] The title of the menu link.
URL [node:book:url] The URL of the menu link.
Absolute URL [node:book:url:absolute] The absolute URL.
Alias [node:book:url:alias] The alias of the URL.
Internal path [node:book:url:path] The internal Drupal path of the URL.
Relative URL [node:book:url:relative] The relative URL.
yes, you are right. I didn't
yes, you are right. I didn't noticed these tokens because they were collapsed.
Thank you
Tomas
can you help me set the right tokens?
Hi everybody,
can you please help me to set the right tokens for my auto path?
I would like to have all my books ordered in a way similar to "books/BookName/ChapterName/SectionName/...../BookPage" but i can't manage to make it work.
I have tried to set: "books/[book:root:title]/[book:parent:title]/[book:title]"
but it is not enough recursive....
It would be great if somebody could give me a hand on this!.
Thanks in advance,
Luca
Hi tomas.teicher, Go to
Hi tomas.teicher,
Go to /admin/build/path/pathauto
And, in the "Node paths" section, set "Pattern for all Book page paths" as follows:
[bookpath-raw]/[title-raw]
It worked fine for me.
Hope this will help you too..:)
Thanks Tomas, it
Thanks Tomas,
it worked.
Cheers, Luca
Hi, what was the solution for
Hi, what was the solution for this? I also want a recursive token that includes all the parents. Thanks.
So that it can help all the
So that it can help all the others, this has worked for me:
[node:book:parent:url:alias]/[node:book:title]
Invalid token
[node:book:parent:url:alias] is not a valid token.
This works currently:
[node:book:parent:url:path]/[node:book:title]
Works for me too
[node:book:parent:url:path]/[node:book:title] works for me too.
book alias
That gave an error, cant contain more than one token.
I got another code from one site [node:book:parent:parent:parent]/[node:book:parent:parent]/[node:book:parent]/[node:title] it worked for me http://vision4life.in
Not a great solution
That is not a great solution unless you know all your book pages are going to have the same number of parents.
I have a same problem
I have a same problem
Botafoc.cat -> Drupal 8 base distribution. Focused on making a base distribution of drupal. The idea is compile the typical modules and configurations that is in vast majory sites using drupal.
Book and Page URL alias tokens.
I've read everything on this page, and tried every combo I can think of, and just not getting anywhere. Extremely frustrated. What am I missing?
I'm looking for a url alias for a book content-type with a child content-type...
/{section}/{book title}/{page title}
{section} is a field in the book content-type, and I've got the book pattern working perfectly fine [node:field_section]/[node:title]
ie. /health/immunizations
It's just the child page (scheduling), I can't seem to get it's parent book url into the page alias.
ie. /health/immunizations/scheduling
Please help.
Have you tried this one -
Have you tried this one - http://drupal.org/node/1212684#comment-5578054
I did and...
It comes up with "array" instead of any value. However, I'm going to look more into it. It's got to be possible.
Works for me too
Thanks @rooby, [node:book:parent:url:path]/[node:book:title] works for me too
for 3 levels
[node:book:parents:join-path]/[node:book:parent:title]/[node:book:title]current solution for creating aliases for book pages
[node:book:parents:join-path]/[node:book]
This works great for my website http://sciencedefine.com/units-and-measurement
Another D7 solultion for creating URL Patterns for book pages
[node:book:parents:join-path]/[node:book:title]
ReggieW
Worked for Me too.
[node:book:parents:join-path]/[node:book:title]
Now is using like :
Now is using like :
[node:book:parent:url:path]/[node:nid]
referrencing : https://www.drupal.org/node/1265672
"The [url:alias] tokens are now [url:path]; The [url:path] tokens are now [url:unaliased:path]"
For Drupal 8 use this
For Drupal 8 use this:
[node:book:parents:join-path]/[node:book:url]