Drupal 7 Drupal 7节点的多别名

Drupal 7 Drupal 7节点的多别名,drupal-7,alias,drupal-views,Drupal 7,Alias,Drupal Views,我需要我的节点具有多个别名,例如www.example.com/1/title-of-node。应通过www.example.com/2/title-of-node或www.example.com/3/title-of-node打开。drupal中是否存在任何用于此的功能?Pathauto不提供此功能。为此,您必须创建一个自定义模块,我正在编写下面的pesudo代码 step1 : create a custom trigger in module step2 : write db_inse

我需要我的节点具有多个别名,例如www.example.com/1/title-of-node。应通过www.example.com/2/title-of-node或www.example.com/3/title-of-node打开。drupal中是否存在任何用于此的功能?Pathauto不提供此功能。

为此,您必须创建一个自定义模块,我正在编写下面的pesudo代码

 step1 : create a custom trigger in module
 step2 : write db_insert query in a function which will be call just after a node is saved in trigger 
db_插入代码如下所示

 $nid = db_insert('url_alias') 
        ->fields(array(
          'alias' => 'another alise',
          'source' => 'node/'.$node->id,
        ))
        ->execute();
在drupalurl\u alise中,表负责保持与节点相关的alise