簡體   English   中英

奏鳴曲頁面捆綁-創建頁面

[英]Sonata Page Bundle - creating a page

我正在嘗試使用Sonata頁面捆綁包,並且已經安裝了它,沒有任何問題,但是在向頁面添加塊時遇到了麻煩。 當我查看Sonata Sandbox時,我可以創建頁面,而當我單擊View Page時,它將自動生成在項目中不執行的塊。

我基本上已經從奏鳴曲沙箱復制了設置。 同樣在sanbox中,如果我已登錄,則無需創建發布即可訪問頁面,而在我的項目中卻找不到錯誤路由。

cmf_routing:
    chain:
        routers_by_id:
            # enable the DynamicRouter with high priority to allow overwriting configured routes with content
            #symfony_cmf_routing_extra.dynamic_router: 200
            # enable the symfony default router with a lower priority
            sonata.page.router: 150
            router.default: 100

sonata_page:
    multisite:             host # host_with_path
    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_cache_esi
        - sonata_page_cache_ssi
        - 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'

    cache_invalidation:
        service:  sonata.page.cache.invalidation.simple
        recorder: sonata.page.cache.recorder
        classes:
            "Application\Sonata\PageBundle\Entity\Block": getId

    default_template: default
    templates:
        default: { path: 'SonataPageBundle::layout.html.twig', name: 'default' }
        2col: { path: 'SonataPageBundle::2columns_layout.html.twig', name: '2 column' }

    page_defaults:
        homepage: {decorate: false, enabled: true}

    #caches:
    #    esi:
    #        token:    add an unique token here # default is a random value
    #        version:  3                        # version 3 is the default on debian wheezy ...
    #        servers:
    #            # you need to ajust this configuration to match your varnish configuration
    #            - %sonata_page.varnish.command%
    #    ssi:
    #        token:    add an unique token here # default is a random value

    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


# Enable Doctrine to map the provided entities
doctrine:
    orm:
        entity_managers:
            default:
                mappings:
                    ApplicationSonataPageBundle: ~
                    SonataPageBundle: ~  

感謝您的任何建議

1-您是對的,從前端站點登錄,創建頁面,然后單擊“查看頁面”將自動生成塊。 太棒了,但是很遺憾, 該功能將在以后的版本中刪除 (包括說明)

要暫時使用它,請閱讀完整配置選項

sonata_page:
    (...)
    is_inline_edition_on: true

2-不知道 要執行全局發布,以防萬一:

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

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM