dongru2019 2016-08-01 13:02
浏览 80

致命错误而不是404页面

I've followed the guide in the documentation on making a resource contenttype and using it for a 404 page, but instead of the page I see the following fatal error:

Class: Symfony\Component\HttpKernel\Exception\HttpException
Message: The page could not be found, and there is no 'notfound' set in 'config.yml'. Sorry about that.
Code: 0

It's strange, because notfound in config.yml is set to:

notfound: resources/not-found

Any idea what it could be? Here is the contenttype:

resources:
name: Resources
singular_name: Resource
fields:
    title:
        type: text
        class: large
        required: true
    slug:
        type: slug
        uses: title
    html:
        type: textarea
        height: 150px
default_status: published
record_template: resource.twig
searchable: false
viewless: true

And resource.twig:

{{ record.title }}

Unique alias of the 404 resource I created is /resources/not-found

  • 写回答

2条回答 默认 最新

  • duanhuau567787 2016-08-01 13:28
    关注

    Ensure the resources record is "published".

    …if I had $1 for every time I had personally hit this one as a result, it'd be holiday time.

    评论

报告相同问题?