1

我对 Lektor 并不完全陌生,但几年前我最后一次使用它。现在我有一个问题,即流块显示在管理视图中而不是内容视图中。

speisekarte.html

{% extends "layout.html" %}
{% block title %}{{ this.title }}{% endblock %}
{% block body %}

    <nav>
       <table class="nav navbar-nav">
           <tr>
            {% for href, title in [
            ['/speisekarte', 'Salate'],
            ['/speisekarte/vorspeise', 'Vorspeise'],
            ['/speisekarte/suppen', 'Suppen'],
            ] %}
            <td{% if this.is_child_of(href) %} class="active"{% endif
            %}><a href="{{ href|url }}">{{ title }}</a></td>
            {% endfor %}
           </tr>
      </table>
    </nav>

<!--<h2>{{ this.title }}</h2>-->
{{ this.body }}

{% for blk in this.demo_flow.blocks %}
<div class="block block-{{ blk._flowblock }}">
    {{ blk }}
</div>
{% endfor %}


speisekarte.ini
[model]
name = Speisekarte
label = {{ this.title }}

[fields.title]
label = Title
type = string

[fields.salat]
lable = Salat
type = flow
flow_blocks = Text Block

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

gericht.ini
[block]
name = Text Block
button_label = Text

[fields.text]
label = Name
type = markdown

[fields.preis]
label = Preis
type = markdown

[fields.inhalt]
label = Inhalt
type = markdown

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

0 回答 0