【问题标题】:Inputfield for link to any contenttype in Bolt-cms用于链接到 Bolt-cms 中任何内容类型的输入字段
【发布时间】:2015-08-25 10:27:16
【问题描述】:

是否可以设置一个链接到多种内容类型的特定内容的字段?

所以假设有 3 个预定义的内容类型 CA、CB、CC。我想设置一个输入字段,允许链接到内容类型 CA、CB、CC 的任何内容。

有人知道怎么做或者螺栓的哪一部分需要延长吗?

非常感谢!


我找到了以下三种链接到其他页面的方法,但它们始终只链接到一种内容类型。

通过选择条目

selectentry:
        type: select
        values: entries/id
        postfix: "Select an entry"
        autocomplete: true
        sort: title

单一关系

relations:
    entries:
        multiple: false
        label: "Choose an entry"
        order: -id
        format: "{{ item.title|escape }} <span>(№ {{ item.id }})</span>"
        postfix: "By selecting an Entry, you're creating a bi-directional relationship to that Entry."

多重关系

relations:
    pages:
        multiple: true
        order: title
        label: Select zero or more pages

【问题讨论】:

    标签: bolt-cms


    【解决方案1】:

    目前无法以干净的方式进行。您可以添加一些type: select 字段,然后在您的模板中使用{% if %} 语句来显示正确的内容。

    【讨论】:

      猜你喜欢
      • 2015-06-11
      • 1970-01-01
      • 2018-08-21
      • 1970-01-01
      • 2017-10-11
      • 1970-01-01
      • 1970-01-01
      • 2016-09-08
      • 1970-01-01
      相关资源
      最近更新 更多