[development] URL Aliasing content types?

As If Productions everyone at asifproductions.com
Mon Sep 21 03:16:39 UTC 2009


At 08:03 PM 9/20/2009, rajasekharan <websweetweb at gmail.com> wrote:
>How can I create url alias for all nodes created as stories to a certain
>format. For example - node/4 beomes /post/4. Are there any existing
>modules to do this task?

The answer you'll hear is Pathauto.  Or you can do this inside your 
own module...

function mymodule_nodeapi(&$node, $op) {
         switch($op) {
                 case 'insert' :
                         if($node->type == 'story') {
                                 $node->path = 'story/' . $node->nid;
                                 path_set_alias("node/$node->nid", 
$node->path);
                                 }
                         }
                         break;
         }
}

LVX
TF


---
As If Productions
http://www.asifproductions.com
Interactive Worlds and Immersive Obsessions



More information about the development mailing list