Generate path by node type without Pathauto

Hi!

Is it possible to generate url aliases to nodes by their type without pathauto? I.e. topic/234, forum/456, where topic and forum are some content types? Maybe url_alter may help with that?

Groups:
Login to post comments

You could use nodeapi

markus_petrux's picture
markus_petrux - Thu, 2009-09-03 21:28

Implement $op 'insert' to create the alias, $op 'delete' to delete the alias, ...

http://api.drupal.org/api/function/hook_nodeapi/6


I use url_alter to implement

Mr.Alinaki - Fri, 2009-09-04 08:59

I use url_alter to implement outbound an inbound on my site. But I don't understand, how I can get node type in that functions.


Read url_alter.api.php for details

markus_petrux's picture
markus_petrux - Fri, 2009-09-04 10:35

...and then, you probably need to read the node to know the type it is.

Note that this function is used a lot, so you may want to optimize all you do here.


has to be asked...

greggles's picture
greggles - Fri, 2009-09-04 13:02

Why not Pathauto?

What are you trying to do? custom_url_rewrite_* and url_alter and hook_menu_alter all may be important/useful toward the goal depending on what you are doing.