0

I'm not sure if this is the appropriate place for this question (I'm a self-proclaimed newbie)...I have a vocabulary with the following scheme:
category1
   subcategory1a
   subcategory1b

I'm trying to create a URL pattern for the content path so it has the following URL pattern: category1/subcategory1a/[node:title]. I have Drupal 7.22, Entity API 7.x-1.0-rc3, and Pathauto 7.x-1.1 and have been trying different token patterns in the URL aliases section. If I set the pattern to be [node:field-VOCABULARYNAME]/[node:title], then the URL alias generated is: category1-subcategory1a/[node:title].
Is there a way to have a "/" appear between the parent term and subterm instead of a dash?

Or is there a way to create the pattern: [node:field-VOCABULARYNAME:0]/[node:field-VOCABULARYNAME:1]/[node:title]?

The tokens related to individual content items ("nodes") listed are:
[node:field-VOCABULARYNAME]
   [node:field-VOCABULARYNAME:1]
   [node:field-VOCABULARYNAME:2]
   [node:field-VOCABULARYNAME:3]

If I set the pattern to [node:field-VOCABULARYNAME]/[node:field-VOCABULARYNAME:1]/[node:title], then the URL alias generated is: category1-subcategory1a/subcategory1a/[node:title].

In my content type, I have the field set up as a Hierarchical Select widget with Term reference as the field type.

I found this StackOverflow post (Drupal 7: Pathauto hierarchical taxonomy terms pattern) and it seemed most relevant to me, but I do not have the taxonomy term tokens listed.

Thank you for your guidance

apaderno
  • 28,547
  • 16
  • 75
  • 90
ForTheWin
  • 617
  • 1
  • 8
  • 15

3 Answers3

0

Hi this should do what you are looking for:

[node:field-VOCABULARYNAME:parents]/[node:field-VOCABULARYNAME:name]/[node:title]

Make sure to update "taxonomy term paths" under the "bulk update" afterwards.

pete80
  • 545
  • 4
  • 13
  • Dear @pete80, thank you so much for responding & for the tip. For some reason, that pattern generated an error for me (I recently inherited this site & the structure probably wasn't set up right). This link provided the answer for me: [link]http://drupal.stackexchange.com/questions/27141/how-can-i-use-pathauto-to-generate-urls-for-deeply-nested-vocabularies. I needed to enable the Taxonomy Entity Index module & then could enter [node:terms:join:/]/[node:title] as the pattern under "Content Paths" & used [term:parent:name]/[term:name] under "Taxonomy Term Paths" & got the desired results. – ForTheWin Aug 02 '13 at 17:07
0

This is a pattern that I have been using to structure my term URLs like so "/parent/parent/term"

browse/[term:parent:parent:name]/[term:parent:name]/[term:name]

Replace [term:name] with [node:title]

Matt Glaman
  • 239
  • 3
  • 14
0

This link provided the answer for me: https://drupal.stackexchange.com/questions/27141/how-can-i-use-pathauto-to-generate-urls-for-deeply-nested-vocabularies.

I needed to enable the Taxonomy Entity Index module & then could enter [node:terms:join:/]/[node:title] as the pattern under "Content Paths" & used [term:parent:name]/[term:name] under "Taxonomy Term Paths" & got the desired results.

I hope this helps someone!

Community
  • 1
  • 1
ForTheWin
  • 617
  • 1
  • 8
  • 15