driuwt9557 2013-08-01 18:40
浏览 28

Drupal 7 - 以编程方式标记节点

I am trying to populate the content of a Drupal 7 site programatically by reading from a CSV file. I have all the code for that, but the next step is to automatically tag each node with a series of terms found in 3 different columns.

Now I know that I can tag the node using the term id, but is there a way to tag using the term name?

I'm looking at something like this where $tags is an array of strings that are supposed to be tag terms.

$a = 0;
foreach ($tags as $tag) {
  $node->field_tags[$node->language][]['a'] = $tag;

I appreciate any help I can get. Thanks!

  • 写回答



      相关推荐 更多相似问题


      • ¥15 SQL 表中 考勤记录的组合查询
      • ¥15 Power pivot无法刷新数据
      • ¥15 刚入职被要求写这种文档,应该如何下手
      • ¥15 最优经济尺寸设计问题
      • ¥15 从多元正态分布中生成3维样本
      • ¥15 GEO下载数据的处理报错 :函数‘Meta’标签‘"data.frame"’找不到继承方法,如何解决?
      • ¥15 android object box 一个实体多个表怎么写
      • ¥15 temux 启用docker 服务失败
      • ¥15 Flask 使用celery发送邮件出现‘目标计算机积极拒绝‘
      • ¥15 超时跳出方法代码的返回值问题