Version

Documentation » Page

9. Advanced Configuration »

« 7. Command Line Tools

8. Advanced usage

8.1. Ignore options

By default, the PageBundle decorates all pages. However it is possible to tweak this behavior by ignoring patterns :

  • ignore_route_patterns : based on pattern
  • ignore_routes : based on the route name
  • ignore_uri_patterns : based on the an uri pattern
sonata_page:
    ignore_route_patterns:
        - /(.*)admin(.*)/   # ignore admin route, ie route containing 'admin'
        - /^_(.*)/          # ignore symfony routes

    ignore_routes:
        - sonata_page_esi_cache
        - sonata_page_js_cache

    ignore_uri_patterns:
        - /admin(.*)/     # ignore admin route, ie route containing 'admin'

8.2. Page defaults options

It’s possible to redefine settings for autogenerated pages (like command update core routes):

  • page_defaults : defaults for page properties, used in update page

    routes command

sonata_page:
    page_defaults:
        homepage: {decorate: false} # disable decoration for homepage route_name

8.3. Contextual Cache

You can configure the Twig Recorder with the following configuration:

twig:
    base_template_class: Sonata\PageBundle\Twig\TwigTemplate13
    base_template_class: Sonata\PageBundle\Twig\TwigTemplate14

// todo add more information

Found a typo? Something is wrong in this documentation? Just fork and edit it!