SonataPageBundle在带有管理部分的页面上添加新块



我安装了sonapagebundle,并使用命令行生成所有路由:

php app/console sonata:page:update-core-routes --site=all

当我进入公共主页管理部分的composer页面时,我收到了这样的消息:

Warning! Before using the composer option, you need to configure the template layout.
The configuration must be done in the sonata_page.templates section.
See a complete exemple here:
sonata_page:
# [...]
templates:
    default:
        path: 'ApplicationSonataPageBundle::demo_layout.html.twig'
        name: 'default'
        containers:
            header:
                name: Header
            content_top:
                name: Top content
            content:
                name: Main content
            content_bottom:
                name: Bottom content
            footer:
                name: Footer
        matrix:
            layout: |
                HHHHHHHH
                TTTTBBBB
                TTTTBBBB
                TTTTBBBB
                TTTTBBBB
                CCCCCCCC
                CCCCCCCC
                FFFFFFFF
            mapping:
                H: header
                T: content_top
                C: content
                B: content_bottom
                F: footer

但是我的config.yml有一行用于sonata_page类别。我做错了什么?

谢谢你的帮助。

我遇到了同样的问题。。。问题是在config.yml中我有两次

templates:
    default: {path: 'SonataPageBundle::layout.html.twig', name: default }
...
templates:
    default:
        path: 'ApplicationSonataPageBundle::layout.html.twig'
        name: 'default'
...

因此,再次检查您的config.yml文件,并删除重复的情况。

最新更新