Details
-
Story
-
Resolution: Fixed
-
Medium
-
None
-
None
Description
In the current EditorialBundle implementation, our custom YUI modules with their dependencies are directly declared in the Twig pagelayout and we are using Assetic to generate a minified version of each module file while the grunt build system is able to generate the static minifed versions.
To ease the process, the YUI modules and some configuration settings (like filter) should be declared in a Symfony YML configuration file and a Twig function should be responsible for generating a correct YUI configuration.
For instance with the following configuration:
parameters: yui: modules: ez-editorialapp: requires: ['app', 'app-transitions', 'node-screen', 'json', 'parallel', 'ez-contenteditview'] path: js/apps/ez-editorialapp.js ez-templatebasedview: requires: ['view', 'handlebars'] path: js/view/ez-templatebasedview.js filter: min
The following Twig template:
<script>
{{ ez_editorial_yui_config( "YUI.GlobalConfig" ) }}
</script>
would result in
<script> YUI.GlobalConfig = { modules: { "ez-editorialapp": { requires: ['app', 'app-transitions', 'node-screen', 'json', 'parallel', 'ez-contenteditview'], fullpath: "/bundles/ezeditorial/js/apps/ez-editorialapp.js" }, "ez-templatebasedview": { requires: ['view', 'handlebars'], fullpath: "/bundles/ezeditorial/js/view/ez-templatebasedview.js" } }, filter: "min" }; </script>
Attachments
Issue Links
- relates to
-
EZP-23096 As a developer, I want to have a clear spec/examples of the PlatformUIBundle semantic configuration and how external bundles can modify it
- Closed