1

イベント content_type_template を使用できません。公式チュートリアル ( http://doc.lomotivecms.com/guides/content-types/create ) を繰り返すと、エラー:ページが見つかりません。助けてください、私はまだこの問題を 3 時間解決しようとしています!

/app/content_types/events.yml

name: Events

slug: events

description: List of all events

label_field_name: title

order_by: manually # default: manually, also available: created_at or any field slug

# order_direction: asc # default: asc, also available: desc

# group_by: <your field>

# public_submission_enabled: false

# public_submission_accounts: ['john@acme.net']


fields: 
- title: # Name of the field
    label: Title
    type: string
    required: true

- description: # Name of the field
    label: Description
    type: text
    required: false
    # Enable or not the RTE [html|text]
    # text_formatting: html

- event_date: # Name of the field
    label: Event date
    type: date
    required: false

/app/views/pages/events/content_type_template.liquid *は手動で作成されました! *

--
title: Event template page

content_type: events

published: true
---
{% extends parent %}

{% block main %}
    <h1>{{ event.title }} on {{ event.event\_date || localized_date: '%m/%d/%Y' }}</h1>
    <p>{{ event.description }}</p>
{% endblock %}

/app/views/pages/index.liquid

{% extends parent %}

{% block main %}

  <ul>
    {% for event in contents.events %}
      <li><a href="/events/{{ event._slug }}">{{ event.title }}</a></li>
    {% endfor %}
  </ul>

{% endblock %}
4

1 に答える 1