Hello,

I'm trying to automatically set a path alias using the path module but it is not working.

Here is what I'm doing:

<?php

function projectCreation_nodeapi(&$node, $op, $a3=NULL, $a4=NULL){
        switch($op){
        case 'submit':
                $name = get_name( $node->filed_project_key[0]['value'] );
                $node->path = t("project/$name/home");
                break;
        case 'insert':
                projectCreation_insert($node);
                break;
        case 'load':
                return array();
        }
}

?>

Comments

1sp’s picture

try using the "presave" operation. So it would be

        switch($op){
        case 'submit':
        case 'presave':
                $name = get_name( $node->filed_project_key[0]['value'] );

Sudhir