Lektor flow blocks are not displayed

102 Views Asked by At

Following the Lektor flow documentation I created a simple block and included in the page model. However this 'text' block doesn't show in the webpage. There are no errors in the console.

Could someone point what I have been doing wrong.

/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>
1

There are 1 best solutions below

0
Arky On

You need to edit your templates/page.html to include something like '{{ this.text }}' to show your block.

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