Drupal - How to set URL alias automatically for a content type WITHOUT using Pathauto? Which hook to implement?
/**
* Implements hook_node_insert()
*/
function mymodule_node_insert($node) {
if ($node->type == 'mytype') {
$node->path['alias'] = 'mytype/' . $node->nid;
}
}
Additionally, you may add this code to hook_node_update()