我正在尝试在Drupal 8中找到用于Pathauto模式的正确令牌。
在Drupal 7中,我有一个Pathauto模块模式,它创建了一个带有节点的术语和父项的URL别名。
因此,如果该节点的术语参考为 Health - >饮食。该网址为health/diet/node-title
。
生成此图案的模式为[node:field-topic:0:parents:join-path]/[node:field-topic:0]/[node:title]
注意:0
是因为术语参考字段允许多个值。
答案 0 :(得分:0)
感谢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的文章的别名:/articles/a/b/c/pathauto-test