【问题标题】:Retrieving taxonomy term url from node in Drupal 7从 Drupal 7 中的节点检索分类术语 url
【发布时间】:2012-12-02 12:59:50
【问题描述】:

每当创建/更新/删除节点时,我正在使用 Authcache 为经过身份验证的用户缓存页面,并使用 Authcache Actions+Rules 来使 node:url + 缓存中的首页过期。 我创建了一个规则事件“在保存内容之前”+ 3 个操作“通过路径 [node:url] 清除缓存”、“通过路径 [node:edit-url] 清除缓存”和“通过路径 [site:url] 清除缓存” 所有节点都标记有至少 1 个分类术语,并且节点预告片出现在分类术语页面上。因此,我需要创建一个规则来清除节点中标记的分类术语页面的缓存。到目前为止,我找不到解决方案。 有关如何创建此规则的任何建议?

提前谢谢你。 卡塔林

【问题讨论】:

    标签: url drupal drupal-7 taxonomy


    【解决方案1】:

    要从 tid(附加到节点)加载分类术语的 url,请使用:

    $tid = $node->your_taxonomy_field['und'][0]['tid'];
    $taxonomy_term_url = drupal_lookup_path('alias', 'taxonomy/term/'.$tid);
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2012-07-27
      • 1970-01-01
      • 1970-01-01
      • 2017-03-19
      • 2016-09-04
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多