【问题标题】:Tokens for taxonomy term parents in Drupal 8 PathautoDrupal 8 Pathauto 中分类术语父项的标记
【发布时间】:2017-01-05 00:02:56
【问题描述】:

我正在尝试在 Drupal 8 中找到用于 Pathauto 模式的正确标记。

在 Drupal 7 中,我有一个 Pathauto 模块模式,它使用节点的术语和父术语创建 URL 别名。

所以如果节点有一个 Health -> Diet 的 Term 引用。该 URL 将是 health/diet/node-title

生成这个的模式是[node:field-topic:0:parents:join-path]/[node:field-topic:0]/[node:title]

注意:0 是因为术语引用字段允许多个值。

【问题讨论】:

标签: drupal drupal-8


【解决方案1】:

在此感谢 Berdir 的帮助 https://drupal.stackexchange.com/questions/224607/tokens-for-taxonomy-term-parents-in-pathauto/224754#224754

自 Drupal 7 以来,令牌发生了一些变化。请参见下面的示例。

令牌:/articles/[node:field_tags:0:entity:parents:join-path]/[node:field_tags:0:entity]/[node:title]

标签层次结构:A > B > C

带有 C 标记的文章的别名:/articles/a/b/c/pathauto-test

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2016-04-26
    • 2016-06-02
    • 1970-01-01
    • 1970-01-01
    • 2017-05-21
    • 1970-01-01
    • 2016-09-04
    相关资源
    最近更新 更多