SonataPageBundle - 没有版权

时间:2016-06-08 15:29:38

标签: symfony sonata

我设法安装完整的奏鸣曲管理员和奏鸣曲页面包。我的问题是我没有内联版本...在我的树枝模板中,sonata_page.isEditor是假的。

我正在使用超级管理员帐户,试图克服一个anfrer anfd给了他所有权利......没有任何效果。

有人能帮助我吗?

这是config.yml中的sonata_page块:

sonata_page:
multisite: host
is_inline_edition_on:  true
use_streamed_response: false # set the value to false in debug mode or if the reverse proxy does not handle streamed response
ignore_route_patterns:
    - ^(.*)admin(.*)   # ignore admin route, ie route containing 'admin'
    - ^_(.*)          # ignore symfony routes

ignore_routes:
    - sonata_page_esi_cache
    - sonata_page_ssi_cache
    - sonata_page_js_sync_cache
    - sonata_page_js_async_cache
    - sonata_cache_esi
    - sonata_cache_ssi
    - sonata_cache_js_async
    - sonata_cache_js_sync
    - sonata_cache_apc

ignore_uri_patterns:
    - ^/admin\/   # ignore admin route, ie route containing 'admin'

page_defaults:
    homepage: {decorate: true} # disable decoration for homepage, key - is a page route

assets:
    stylesheets: 
        # Defaults:
        - bundles/sonatacore/vendor/bootstrap/dist/css/bootstrap.min.css
        #- bundles/sonatapage/sonata-page.front.css
    javascripts:
        # Defaults:
        - bundles/sonatacore/vendor/jquery/dist/jquery.min.js
        - bundles/sonatacore/vendor/bootstrap/dist/js/bootstrap.min.js
        #- bundles/sonatapage/sonata-page.front.js

default_template: default # template key from templates section, used as default for pages
templates:
    default: 
        path: AppBundle::standard_layout.html.twig
        name: default 
        containers:
            header:
                name: Header
            content_top:
                name: Conteneur (Haut)
            content:
                name: Contenu principal
            content_bottom:
                name: Conteneur (Bas)
            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





# manage the http errors
catch_exceptions:
    not_found: [404]    # render 404 page with "not_found" key (name generated: _page_internal_error_{key})
    fatal:     [500]    # so you can use the same page for different http errors or specify specific page for each error

和我的security.yml文件:

security:
encoders:
    # Application\Sonata\UserBundle\Entity\User:
    #     algorithm: sha512
    #     encode_as_base64: true
    #     iterations: 2
    AppBundle\Entity\User:
        algorithm: sha512
        encode_as_base64: true
        iterations: 2acl:
    connection: default

role_hierarchy:
    ROLE_ADMIN:       [ROLE_USER, ROLE_SONATA_ADMIN]
    ROLE_SUPER_ADMIN: [ROLE_ADMIN, ROLE_ALLOWED_TO_SWITCH]
    SONATA:
        # if you are not using acl then this line must be uncommented
        #- ROLE_SONATA_PAGE_ADMIN_PAGE_EDIT
        #- ROLE_SONATA_PAGE_ADMIN_BLOCK_EDIT

providers:
    fos_userbundle:
        id: fos_user.user_manager

firewalls:
    # disables authentication for assets and the profiler, adapt it according to your needs
    dev:
        pattern: ^/(_(profiler|wdt)|css|images|js)/
        security: false

    admin:
        pattern:            /admin(.*)
        context:            user
        form_login:
            provider:       fos_userbundle
            login_path:     /admin/login
            use_forward:    false
            check_path:     /admin/login_check
            failure_path:   null
        logout:
            path:           /admin/logout
            target:         /admin/login
        anonymous:          true

    main:
        pattern:             .*
        context:             user
        form_login:
            provider:       fos_userbundle
            login_path:     /login
            use_forward:    false
            check_path:     /login_check
            failure_path:   null
        logout:             true
        anonymous:          true
        #switch_user: true

access_control:
    # URL of FOSUserBundle which need to be available to anonymous users
    - { path: ^/login$, role: IS_AUTHENTICATED_ANONYMOUSLY }
    - { path: ^/register, role: IS_AUTHENTICATED_ANONYMOUSLY }
    - { path: ^/resetting, role: IS_AUTHENTICATED_ANONYMOUSLY }

    # Admin login page needs to be accessed without credential
    - { path: ^/admin/login$, role: IS_AUTHENTICATED_ANONYMOUSLY }
    - { path: ^/admin/logout$, role: IS_AUTHENTICATED_ANONYMOUSLY }
    - { path: ^/admin/login_check$, role: IS_AUTHENTICATED_ANONYMOUSLY }
    - { path: ^/admin/resetting, role: IS_AUTHENTICATED_ANONYMOUSLY }

    # Secured part of the site
    # This config requires being logged for the whole site and having the admin role for the admin part.
    # Change these rules to adapt them to your needs
    - { path: ^/admin/, role: [ROLE_ADMIN, ROLE_SONATA_ADMIN] }
    - { path: ^/.*, role: IS_AUTHENTICATED_ANONYMOUSLY }

以防万一,我的sonata_block阻止:

sonata_block:
context_manager: sonata.page.block.context_manager
default_contexts: [cms]
blocks:
    sonata.admin.block.admin_list:
        contexts:   [admin]

    sonata.admin_doctrine_orm.block.audit:
       contexts:   [admin]

    sonata_admin_doctrine_phpcr.tree_block:
        settings:
            id: '/cms'
        contexts:   [admin]

    sonata.block.service.text:
    sonata.block.service.rss:

    # Some specific block from the SonataMediaBundle
    sonata.media.block.media:
        cache: sonata.cache.predis
    sonata.media.block.gallery:
    sonata.media.block.feature_media:  
    sonata.seo.block.social.container:
    sonata.seo.block.email.share_button:
    sonata.seo.block.facebook.like_box:
    sonata.seo.block.facebook.like_button:
    sonata.seo.block.facebook.send_button:
    sonata.seo.block.facebook.share_button:
    sonata.seo.block.twitter.share_button:
    sonata.seo.block.twitter.follow_button:
    sonata.seo.block.twitter.hashtag_button:
    sonata.seo.block.twitter.mention_button:
    sonata.seo.block.twitter.embed:
    sonata.seo.block.pinterest.pin_button: 

    sonata.page.block.children_pages:
    sonata.formatter.block.formatter:

    sonata.media.block.media:
    sonata.media.block.gallery:
    sonata.media.block.feature_media:

    # sonata_admin_doctrine_phpcr.tree_block:
    #     settings:
    #         id: '/cms'
    #     contexts:   [admin]

profiler:
    container_types: ~
    enabled:        "%kernel.debug%"
    template:       SonataBlockBundle:Profiler:block.html.twig

0 个答案:

没有答案