I am using the Bio module and wanted to use the PathAuto module to create a fixed path to each member's Bio.

The default URL for a user Bio is node/123, node/789, etc, etc.

I have used PathAuto to make this bio/john or bio/philip using the user name in the URL. Is there a way of making the URL bio/1 and bio/2 where the UID is used? I tried to add this manually and the URLs were coming out as bio/[uid] as it wasn't an option for that node type to use uid.

what I ultimately want is to use the Me Module to be able to have the fixed URL for bios as bio/me

Comments

greggles’s picture

Title: Creating fixed URL for User Bios » provide uid pattern for nodes
Category: support » feature

Do I understand correctly that you want a pattenr for nodes that provides the uid of the author?

Indeed it looks like this is not currently provided but probably should be. I've changed the title and category to fit with my understanding of the issue.

I think this is reasonable and would be willing to commit a patch that does this. If you can wait long enough I'll even make the patch ;)

esllou’s picture

Ok thanks. I would appreciate that. I look forward to seeing the patch.

ahoeben’s picture

Status: Active » Needs review
StatusFileSize
new1.1 KB

Here's a patch for 5.x

ahoeben’s picture

StatusFileSize
new1.1 KB

...and one for 4.7.x

ahoeben’s picture

Didn't mean to 'steal your thunder' Greggles, but I needed the functionality myself and it was such an easy thing to add... I only tested the 4.7.x version, but the 5.x version is so similar that I don't see how it could not work.

greggles’s picture

Steal my thunder? Please - stick around and make more patches for pathauto :)

This looks pretty good to me. Can anyone else test it (esllou?) and then I can commit it.

Thanks!

esllou’s picture

This seems to be working fine.

One other thing I'd like to know how to avoid. I only want to change the bio URLs.

How can I prevent all the other nodes getting altered? The default is [title] so then I changed that, with forum posts for example, to node/[nid] (as they are by default on drupal) and now my URL Aliases list is full of duplicate needless entries:

node/15 -------- node/15
node/21 -------- node/21

etc.

How do I set it up so it doesn't touch anything but Bios? Is it the bulk update option that I shouldn't be using? My thoughts are that even if I don't choose bulk update, all future forum posts will still generate that duplicate entry in the URL Aliases table.

greggles’s picture

esllou - thanks for the review.

Please note:

When you open and respond to issues please open one issue for each problem/request don't bundle several issues into one submission.

So, yeah, separate support issue for that latest idea, please.

greggles’s picture

Status: Needs review » Fixed

committed to the 5--2 and 4.7 branches. Thanks ahoeben!

ray007’s picture

Version: 5.x-1.x-dev » 5.x-1.1

Is there a reason to not commit this to the DRUPAL-5 branch?
Especially if the plan for 5.2 is to integrate with the token-module?

I just created the exact same patch for myself before I found this issue ...

greggles’s picture

That's probably a good point...I applied it to that branch and it should be in the 1.x-dev tarball by tomorrow and then assuming that goes well for a while I'll make a 1.2 version (which includes a translation fix as well...)

Thanks!

Anonymous’s picture

Status: Fixed » Closed (fixed)