Drupal 7节点的多个别名

时间:2015-11-25 13:14:30

标签: 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没有提供这个。

1 个答案:

答案 0 :(得分:2)

为此你必须创建一个自定义模块我正在编写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_insert代码如下所示

 $nid = db_insert('url_alias') 
        ->fields(array(
          'alias' => 'another alise',
          'source' => 'node/'.$node->id,
        ))
        ->execute();
drupal url_alise 表中的

可以保留与节点相关的alise。

相关问题