문제

I created a page in locomotivecms, under my app/views/pages folders and called it page2.liquid.haml and it contains the following code.

 {% extends 'index' %}

{% block 'main' %}This is the content for the page 2{% endblock %}

I can view the index page, but I am not sure how to view page2 in the browser everything I try leads to a 404.

Any Ideas?

도움이 되었습니까?

해결책

Above the liquid markup, you need to have a YAML file header with the page's title, slug, and published flag, like this:

---
title: Page 2
slug: page2
published: true
---
{% extends 'index' %}

{% block 'main' %}This is the content for the page 2{% endblock %}

You can create files with such headers generated automatically by using the wagon generate page command.

$ bundle exec wagon generate page test_page
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top