0

按照 Lektor 流程文档,我创建了一个简单的块并包含在页面模型中。但是,此“文本”块不会显示在网页中。控制台中没有错误。

有人可以指出我做错了什么。

/models/page.ini

[model]
name = Page
label = {{ this.title }}

[fields.title]
label = Title
type = string

[fields.body]
label = Body
type = markdown

[fields.text]
label = Text Block
type = flow
flow_blocks = text

/flowblocks/text.ini

[block]
name = Text Block
button_label = Text

[fields.text]
label = Text
type = markdown

[fields.class]
label = Class
type = select
choices = default, centered
choice_labels = Default, Centered
default = default

/templates/blocks/text.html

<div class="text-block text-block-{{ this.class }}">
  {{ this.text }}
</div>
4

1 回答 1

1

您需要编辑您的模板/page.html 以包含类似“{{ this.text }}”的内容以显示您的块。

https://github.com/lektor/lektor/issues/790

于 2020-06-24T10:50:23.327 回答