Hi,

I installed the pathauto module and it is working nicely.

http://www.foo.com/test-post.html

Test Post is also a member of a category Foo

It is listed here:

http://www.foo.com/category/foo

but still points here:

http://www.foo.com/test-post.html

How can I get:

http://www.foo.com/category/foo/test-post.html

(and if it the atricle is part of another category, also appear at http://www.foo.com/category/footwo/test-post.html

Thank you.

Comments

venkat-rk’s picture

You can't have two aliases (well, perhaps you can with plenty of coding, I am not sure) for the same node. Just like you can only have your node in one place in the menu tree, so too, with urls/aliases, you can have only one- it is based on the first category your node is tagged with.

For the correct method of using category_pathauto, please consult:
http://category.greenash.net.au/node/202

forefront’s picture

My putting /category/ has nothing to do with that module you referred me to. It's just an example of a category name like "/foo/"

My question remains.

Thanks.

venkat-rk’s picture

Oh, so you meant category in the taxonomy sense. Let me think about your question a little more and see if I can help.

venkat-rk’s picture

Okay, assuming you mean the following:

1.) 'Category' is actually the vocabulary name
2.) 'Foo' a taxonomy term under that vocabulary
3.) testpost.html is the node you are creating and tagging with the taxonomy term foo.

Here is the solution:

1.) In category path settings, put [vocab]/catpath] or [vocab]/[cat] in the field for the vocabulary 'Category'
2.) In the node path settings, put [vocab]/catpath] or [vocab]/[cat]/[title].html in the setting for the node type (for example, story node type) you are using to make test-post.html

Note: You need to use [catpath] if your vocabulary has multiple parents that each have their own children. If you have a flat vocabulary (a listing of terms without any hierarchy), just use [cat]

Be aware that, unlike for taxonomy terms, Drupal does not have a mechanism to automatically provide a listing page for your vocabulary. You will have to either code or use something like the taxonomy_vocabulary module. Try contacting drupal.org user 'budda' for this module.

Edit: If you tag this post with a second category, it will also be listed on that taxonomy term page, but the url will always be just one and will point to the first category you tag your post with. To get the url of your liking, weight the vocabularies so that your preferred category appears first in the listing on the node creation form.

forefront’s picture

Hi,

Thanks, you got it right!

I want to offer:

example.com/level1/level2/page.html

which of course works fine.

But when someone types:

example.com/level1/level2/

or example.com/level1/

They get page not found.

How can I create an index page at each node so that it lists the posts/stories and sub-nodes under it (its "children")?

Thank you!

PS: If you're about yo say "taxonomy_vocabulary" - I cannot find that in any of the links given

Leeteq’s picture

The makers of the now "withdrawn" taxonomy_vocabulary module refers to that you can create such listings - or "views" - using the much more powerful Views module.

See Ramdak's explanation of how to make such a view here:
http://drupal.org/node/17245

Further up that post are some old references to alternative methods too, could be interesting related knowledge.
("List all terms in one particular vocabulary")

.
--
( Evaluating the long-term route for Drupal 7.x via BackdropCMS at https://www.CMX.zone )

greeneo’s picture

Oops, posted in the wrong browser tab.