how to override pathauto.module?

sadist - November 9, 2009 - 12:43
Project:Pathauto
Version:6.x-2.x-dev
Component:Code
Category:support request
Priority:normal
Assigned:Unassigned
Status:fixed
Description

I created a module (more like just a content-type) which is actually a copy of blog.module. My reason is, so that pathauto.module will automatically generate alias of content-types for users.
e.g.:
http://username.mysite.com/video
http://username.mysite.com/photo

With only Views, I can't get the path since there's no way I am able to place an argument as the first path. I'd tried working this with RewriteRule, domain.module, and none works as what I want.

My question is, how can I override some functions in pathauto.module? I wouldn't want to just hack the module and make a mess out of it, then get screwed up when I update the module. In other words, I prefer doing the Drupal way.

Anyone care to guide? Cheers!

#1

greggles - November 9, 2009 - 15:48

Do you want to define aliases at "video" that actually point to something internally like "node/125" or do you want a menu element at "video" that accepts arguments the same way that the "blog" element at example.com/blog is a menu entry that can take a UID and return blog posts for that uid?

#2

sadist - November 10, 2009 - 00:16

greggles, thanks!

yes, it's the latter one that i'm looking for. i have no problem with setting up path for nodes. but i want the same way like 'blog' to list down all posts of that particular node-types for the uid.

#3

greggles - November 10, 2009 - 00:30
Status:active» fixed

You don't want path aliases, you want a menu callback - http://api.drupal.org/api/function/hook_menu

#4

Dave Reid - November 10, 2009 - 00:33

Better yet, SimpleViews is great for that purpose.

#5

sadist - November 23, 2009 - 11:50

Dave, SimpleViews will provide me if I want my path to be like 'video/username' but what I want is to be 'username/video' and it will list down all that user's videos.

 
 

Drupal is a registered trademark of Dries Buytaert.