link 的输入字段到 Bolt-cms 中的任何内容类型
Inputfield for link to any contenttype in Bolt-cms
是否可以设置一个 link 指向多种内容类型的特定内容的字段?
所以假设有 3 个预定义的内容类型 CA、CB、CC。我想设置一个输入字段,允许 link 到内容类型 CA、CB、CC 的任何内容。
有谁知道如何做这个或需要延长螺栓的哪一部分?
非常感谢!
我发现了以下三种 link 到其他页面的方法,但它们总是 link 到一种内容类型。
通过选择条目
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
目前无法以干净的方式做到这一点。您可以添加一些 type: select
字段,然后在您的模板中使用 {% if %}
语句来显示正确的内容。
是否可以设置一个 link 指向多种内容类型的特定内容的字段?
所以假设有 3 个预定义的内容类型 CA、CB、CC。我想设置一个输入字段,允许 link 到内容类型 CA、CB、CC 的任何内容。
有谁知道如何做这个或需要延长螺栓的哪一部分?
非常感谢!
我发现了以下三种 link 到其他页面的方法,但它们总是 link 到一种内容类型。
通过选择条目
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
目前无法以干净的方式做到这一点。您可以添加一些 type: select
字段,然后在您的模板中使用 {% if %}
语句来显示正确的内容。