You are browsing upcoming documentation for version 6.0 of OroCommerce, OroCRM, and OroPlatform, scheduled for release in 2024. Read version 5.1 (the latest LTS version) of the Oro documentation to get up-to-date information.

See our Release Process documentation for more information on the currently supported and upcoming releases.

Content Providers

OroPlatform is a hybrid application that supports JS navigation, but it still renders a lot on server side. Usually when a user changes the current page, the application reloads only the content part, so there are parts that not required to be rendered on sever side for each request. To allow a developer to include partial content in the hash navigation response, content providers were introduced.

Content Provider Implementation

To implement a content provider, you need to implement Oro\Bundle\UIBundle\ContentProvider\ContentProviderInterface and register your class as a service with tag oro_ui.content_provider. The alias attribute of this tag is required and it is used to specify a unique name of the content provider.

Optional Providers

By default, all content providers are enabled but if content generated by your provider is optional, you can pass the enabled: false attribute to the tag of provider’s service definition. After that, the content will not be added to response, but optional providers ca be enabled if you pass their names through request parameter _enableContentProviders.


When a page is loaded for the first time, its content is mostly rendered by twig. To get content from the content providers from the twig template, use the oro_get_content Twig function.


Getting an array of all flash:

{% set contentProviderContent = oro_get_content(null, ['flashMessages'])|first %}

The first argument of this Twig function is an array contains an additional content. If there is no an additional content, this argument can by null or empty array. The second argument of this Twig function is an array contains the names of context elements to be returned. If this argument is null or empty array, all context elements will be returned.