The Pathauto.module is great. I made a few changes for my site. I added the capablility of having a different path for each node type. It discovers the current list of node types and creates a path pattern for each one.

I also added two placeholders:

  • [nid] is the node id number
  • [user] is the user name of the author.

I did this for several reasons:

  1. I wanted individual user's blog posts to have their username in the url.
  2. I wanted the node type in the url for several node types to either hide or display certain blocks. I know there are other ways to do this but this also makes the url cleaner. I have forum topic nodes with the word forum and the forum name in the url. I have the right sidebar blocks hidden for image nodes.

I tested this patch on the 4 drupal sites I run.

Drupal 4.6 has some interesting path limiting features for blocks. Unfortunately, its ANDs the path and node types which means that the block will only show up on pages of that node type that also match the path. I would like it to OR the options instead so the block shows up on pages that match the path or are the chosen node type.

Thanks

JJ

CommentFileSizeAuthor
pathauto.patch3.59 KBjdmquin

Comments

kbahey’s picture

Excellent patch.

This is a great module. Let us keep it that way by adding needed functionality.

BTW, does anyone know why this module exists only in the attic?

http://cvs.drupal.org/viewcvs/drupal/contributions/modules/pathauto/

mikeryan’s picture

Thanks for the patch! I've incorporated it into my code and should commit it to CVS today. Apart from some layout changes, the one functional change I made was to preserve the global pattern to be applied to node types without explicit patterns, and made the default pattern for specific types blank. In my case, for example, I'd like [vocab]/[catpath]/[title] to be the pattern for most node types, but use a simple [title] for pages and webforms, and [book]/[title] for book pages...

Thanks again...

mikeryan’s picture

Assigned: Unassigned » mikeryan
mikeryan’s picture

Arran’s picture

I can't get this patch to work...

All I get is...

C:\pathauto>patch < pathauto.patch
patching file pathauto.module
Assertion failed: hunk, file ../patch-2.5.9-src/patch.c, line 354

This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.

C:\pathauto>

Any thoughts? thanks

Oh by the way I've tried unix2dos...

But then patching just gives me...

C:\pathauto>patch -u < pathauto.patch
patching file pathauto.module
Hunk #1 FAILED at 95.
Hunk #2 FAILED at 125.
Hunk #3 FAILED at 156.
Hunk #4 FAILED at 198.
Hunk #5 FAILED at 238.
Hunk #6 FAILED at 280.
6 out of 6 hunks FAILED -- saving rejects to file pathauto.module.rej