### Install Assets (Symfony Flex) Source: https://github.com/friendsofsymfony/fosckeditorbundle/blob/2.x/docs/installation.rst Install CKEditor assets into the public directory when using Symfony Flex. ```bash $ php bin/console assets:install public ``` -------------------------------- ### Display CKEditor Install Command Help Source: https://github.com/friendsofsymfony/fosckeditorbundle/blob/2.x/docs/usage/ckeditor.rst View the comprehensive help documentation for the ckeditor:install command to understand all available options and their usage. ```bash $ php bin/console ckeditor:install --help ``` -------------------------------- ### Integrate CKEditor Installation into Composer Scripts Source: https://context7.com/friendsofsymfony/fosckeditorbundle/llms.txt Automate CKEditor installation and updates by adding the 'ckeditor:install' command to your Composer scripts. ```json { "scripts": { "auto-scripts": { "cache:clear": "symfony-cmd", "ckeditor:install --clear=drop": "symfony-cmd", "assets:install --symlink --relative %PUBLIC_DIR%": "symfony-cmd" }, "post-install-cmd": ["@auto-scripts"], "post-update-cmd": ["@auto-scripts"] } } ``` -------------------------------- ### Install Assets (Symfony <= 2.8) Source: https://github.com/friendsofsymfony/fosckeditorbundle/blob/2.x/docs/installation.rst Install CKEditor assets into the web directory for Symfony versions 2.8 and below. ```bash $ php app/console assets:install web ``` -------------------------------- ### Install CKEditor using Console Command Source: https://context7.com/friendsofsymfony/fosckeditorbundle/llms.txt Use the ckeditor:install command to download and set up the CKEditor 4 library. Various options are available for release types, versions, and custom builds. ```bash php bin/console ckeditor:install ``` ```bash php bin/console ckeditor:install --release=standard ``` ```bash php bin/console ckeditor:install --tag=4.16.0 ``` ```bash php bin/console ckeditor:install /var/www/html/public/ckeditor ``` ```bash php bin/console ckeditor:install --release=custom --custom-build-id=574a82a0d3e9226d94b0e91d10eaa372 ``` ```bash php bin/console ckeditor:install --clear=drop # Drop and reinstall ``` ```bash php bin/console ckeditor:install --clear=keep # Keep and override files ``` ```bash php bin/console ckeditor:install --clear=skip # Skip installation ``` ```bash php bin/console ckeditor:install --exclude=samples --exclude=adapters ``` -------------------------------- ### Install CKEditor Assets Source: https://github.com/friendsofsymfony/fosckeditorbundle/blob/2.x/docs/migration.rst Use the console command to fetch CKEditor assets after migration. ```bash bin/console ckeditor:install ``` -------------------------------- ### Configure Composer Scripts for CKEditor Installation Source: https://github.com/friendsofsymfony/fosckeditorbundle/blob/2.x/docs/usage/ckeditor.rst Integrate CKEditor installation into your composer routine for automated management. This script clears the cache, installs CKEditor, and then installs assets. ```json { "scripts": { "auto-scripts": { "cache:clear": "symfony-cmd", "ckeditor:install --clear=drop": "symfony-cmd", "assets:install --symlink --relative %PUBLIC_DIR%": "symfony-cmd" }, "post-install-cmd": [ "@auto-scripts" ], "post-update-cmd": [ "@auto-scripts" ] } } ``` -------------------------------- ### Install CKEditor4 as Node Module (Yarn) Source: https://github.com/friendsofsymfony/fosckeditorbundle/blob/2.x/docs/installation.rst Install CKEditor4 as a node module dependency using Yarn. ```bash # if you are using Yarn as package manager $ yarn add ckeditor4@^4.13.0 ``` -------------------------------- ### Install a Specific CKEditor Release Type Source: https://github.com/friendsofsymfony/fosckeditorbundle/blob/2.x/docs/usage/ckeditor.rst Choose between 'full', 'standard', or 'basic' CKEditor releases for download. ```bash $ php bin/console ckeditor:install --release=basic ``` -------------------------------- ### Install CKEditor to a Custom Path Source: https://github.com/friendsofsymfony/fosckeditorbundle/blob/2.x/docs/usage/ckeditor.rst Specify a custom absolute path for CKEditor installation if the default bundle directory is not desired. ```bash $ php bin/console ckeditor:install /var/www/html/web/ckeditor ``` -------------------------------- ### Example JSON construction Source: https://github.com/friendsofsymfony/fosckeditorbundle/blob/2.x/docs/usage/json-builder.rst Demonstrates building JSON with custom encode options and mixed value setting, followed by resetting and building another JSON structure. ```php use FOS\CKEditorBundle\Builder\JsonBuilder; $builder = new JsonBuilder(); // {"0":"foo","1":bar} echo $builder ->setJsonEncodeOptions(JSON_FORCE_OBJECT) ->setValues(['foo']) ->setValue('[1]', 'bar', false) ->build(); // {"foo":["bar"],"baz":bat} echo $builder ->reset() ->setValues(['foo' => ['bar']]) ->setValue('[baz]', 'bat', false) ->build(); ``` -------------------------------- ### Install Assets (Symfony >= 3.0, no Flex) Source: https://github.com/friendsofsymfony/fosckeditorbundle/blob/2.x/docs/installation.rst Install CKEditor assets into the web directory for Symfony versions 3.0 and above, when not using Symfony Flex. ```bash $ php bin/console assets:install web ``` -------------------------------- ### Install a Custom CKEditor Build Source: https://github.com/friendsofsymfony/fosckeditorbundle/blob/2.x/docs/usage/ckeditor.rst Use a custom build generated from the CKEditor online builder by providing its build ID. ```bash $ php bin/console ckeditor:install --release=custom --custom-build-id=574a82a0d3e9226d94b0e91d10eaa372 ``` -------------------------------- ### Install a Specific CKEditor Version Source: https://github.com/friendsofsymfony/fosckeditorbundle/blob/2.x/docs/usage/ckeditor.rst Download a specific version of CKEditor by providing a version tag. ```bash $ php bin/console ckeditor:install --tag=4.6.0 ``` -------------------------------- ### Regenerate Symfony Assets Source: https://github.com/friendsofsymfony/fosckeditorbundle/blob/2.x/docs/migration.rst Run the Symfony assets install command to regenerate assets after installing CKEditor. ```bash bin/console assets:install ``` -------------------------------- ### Install CKEditor via Console (Symfony >= 3.0) Source: https://github.com/friendsofsymfony/fosckeditorbundle/blob/2.x/docs/installation.rst Use this command to install CKEditor assets for Symfony versions 3.0 and above. ```bash $ php bin/console ckeditor:install ``` -------------------------------- ### Install CKEditor4 as Node Module (NPM) Source: https://github.com/friendsofsymfony/fosckeditorbundle/blob/2.x/docs/installation.rst Install CKEditor4 as a node module dependency using NPM. ```bash # if you are using NPM as package manager $ npm install --save ckeditor4@^4.13.0 ``` -------------------------------- ### Install CKEditor via Console (Symfony <= 2.8) Source: https://github.com/friendsofsymfony/fosckeditorbundle/blob/2.x/docs/installation.rst Use this command to install CKEditor assets for Symfony versions 2.8 and below. ```bash $ php app/console ckeditor:install ``` -------------------------------- ### Install CKEditor without Progress Bars Source: https://github.com/friendsofsymfony/fosckeditorbundle/blob/2.x/docs/usage/ckeditor.rst Hide the progress bar during the download and installation process. ```bash $ php bin/console ckeditor:install --no-progress-bar ``` -------------------------------- ### Manage Previous CKEditor Installations Source: https://github.com/friendsofsymfony/fosckeditorbundle/blob/2.x/docs/usage/ckeditor.rst Control how the command handles existing CKEditor installations when running in non-interactive mode. Options include 'drop', 'keep', and 'skip'. ```bash $ php bin/console ckeditor:install --clear=drop ``` ```bash $ php bin/console ckeditor:install --clear=keep ``` ```bash $ php bin/console ckeditor:install --clear=skip ``` -------------------------------- ### Install CKEditor via npm Source: https://context7.com/friendsofsymfony/fosckeditorbundle/llms.txt Install CKEditor 4 as a project dependency using npm or Yarn. This is the first step for Webpack Encore integration. ```bash npm install --save ckeditor4@^4.13.0 # or with Yarn yarn add ckeditor4@^4.13.0 ``` -------------------------------- ### Instantiate JsonBuilder Source: https://github.com/friendsofsymfony/fosckeditorbundle/blob/2.x/docs/usage/json-builder.rst Create a new instance of the JsonBuilder to start constructing JSON. ```php use FOS\CKEditorBundle\Builder\JsonBuilder; $builder = new JsonBuilder(); ``` -------------------------------- ### Configure Custom CKEditor Skin Source: https://context7.com/friendsofsymfony/fosckeditorbundle/llms.txt Apply custom CKEditor skins by installing them in the web directory and referencing their name and path in the configuration. ```yaml # config/packages/fos_ck_editor.yaml fos_ck_editor: default_config: my_config configs: my_config: skin: "moono-lisa,/bundles/mybundle/ckeditor/skins/moono-lisa/" ``` -------------------------------- ### Configure HTTP/HTTPS Proxy for CKEditor Installation Source: https://github.com/friendsofsymfony/fosckeditorbundle/blob/2.x/docs/usage/ckeditor.rst Set environment variables for HTTP and HTTPS proxies if you are behind a proxy server. You can also specify if the request URI should be full. ```bash $ export HTTP_PROXY=http://127.0.0.1:8080 ``` ```bash $ export HTTPS_PROXY=http://127.0.0.1:8080 ``` ```bash $ export HTTP_PROXY_REQUEST_FULLURI=true ``` ```bash $ export HTTPS_PROXY_REQUEST_FULLURI=true ``` -------------------------------- ### Register and Configure CKEditor Plugins Globally Source: https://context7.com/friendsofsymfony/fosckeditorbundle/llms.txt Enable and configure CKEditor plugins globally via the bundle's configuration. Ensure plugins are installed in the web directory or a bundle's public resources. ```yaml # config/packages/fos_ck_editor.yaml fos_ck_editor: default_config: my_config configs: my_config: extraPlugins: "wordcount,notification" plugins: wordcount: path: "/bundles/mybundle/ckeditor/plugins/wordcount/" filename: "plugin.js" notification: path: "/bundles/mybundle/ckeditor/plugins/notification/" filename: "plugin.js" ``` -------------------------------- ### Install FOSCKEditorBundle using Composer Source: https://context7.com/friendsofsymfony/fosckeditorbundle/llms.txt Use Composer to add the FOSCKEditorBundle to your Symfony project dependencies. ```bash composer require friendsofsymfony/ckeditor-bundle ``` -------------------------------- ### Register Custom CKEditor Path in Configuration Source: https://github.com/friendsofsymfony/fosckeditorbundle/blob/2.x/docs/usage/version.rst Define the base and JavaScript paths for your custom CKEditor installation in the application's configuration file. Ensure paths are relative to the public directory. ```yaml # app/config/config.yml fos_ck_editor: base_path: "ckeditor" js_path: "ckeditor/ckeditor.js" ``` -------------------------------- ### Configure RequireJS Paths and Shims Source: https://github.com/friendsofsymfony/fosckeditorbundle/blob/2.x/docs/usage/require-js.rst Configure RequireJS to locate CKEditor and define its dependencies and export. This setup is necessary for RequireJS to correctly load CKEditor. ```javascript { paths: { 'ckeditor': '{{ asset("bundles/fosckeditor/ckeditor") }}' }, shim: { 'ckeditor': { deps: ['jQuery'], exports: 'CKEDITOR' } } } ``` -------------------------------- ### Configure Webpack Encore to Copy CKEditor Files Source: https://github.com/friendsofsymfony/fosckeditorbundle/blob/2.x/docs/installation.rst Configure Webpack Encore to copy CKEditor files from node_modules to the build directory. This example excludes the samples directory. ```javascript // webpack.config.js var Encore = require('@symfony/webpack-encore'); Encore // ... .copyFiles([ {from: './node_modules/ckeditor4/', to: 'ckeditor/[path][name].[ext]', pattern: /\.(js|css)$/, includeSubdirectories: false}, {from: './node_modules/ckeditor4/adapters', to: 'ckeditor/adapters/[path][name].[ext]'}, {from: './node_modules/ckeditor4/lang', to: 'ckeditor/lang/[path][name].[ext]'}, {from: './node_modules/ckeditor4/plugins', to: 'ckeditor/plugins/[path][name].[ext]'}, {from: './node_modules/ckeditor4/skins', to: 'ckeditor/skins/[path][name].[ext]'}, {from: './node_modules/ckeditor4/vendor', to: 'ckeditor/vendor/[path][name].[ext]'} ]) // Uncomment the following line if you are using Webpack Encore <= 0.24 // .addLoader({test: /\.json$/i, include: [require('path').resolve(__dirname, 'node_modules/ckeditor')], loader: 'raw-loader', type: 'javascript/auto'}) ; ``` -------------------------------- ### Reset the builder Source: https://github.com/friendsofsymfony/fosckeditorbundle/blob/2.x/docs/usage/json-builder.rst Use the reset method to clear the builder's state and start a new JSON construction. ```php $builder->reset(); ``` -------------------------------- ### Customize CKEditor Configuration in Symfony Form Source: https://github.com/friendsofsymfony/fosckeditorbundle/blob/2.x/docs/index.rst Example of customizing CKEditor configuration within a Symfony form type. This snippet shows how to set specific UI colors and other CKEditor options. ```php use FOS\CKEditorBundle\Form\Type\CKEditorType; $builder->add('field', CKEditorType::class, [ 'config' => [ 'uiColor' => '#ffffff', //... ], ]); ``` -------------------------------- ### Run Webpack Encore Build (NPM) Source: https://github.com/friendsofsymfony/fosckeditorbundle/blob/2.x/docs/installation.rst Execute the Webpack Encore build command using NPM. ```bash # if you are using NPM as package manager $ npm run dev ``` -------------------------------- ### Configure Content Templates Globally Source: https://context7.com/friendsofsymfony/fosckeditorbundle/llms.txt Set up content templates that users can insert into the editor. This involves defining template paths and structures in the bundle's configuration. ```yaml # config/packages/fos_ck_editor.yaml fos_ck_editor: default_config: my_config configs: my_config: extraPlugins: "templates" templates: "my_templates" templates: my_templates: imagesPath: "/bundles/mybundle/templates/images" templates: - title: "Image with Caption" image: "template1.jpg" description: "An image with a text caption" html: "
Caption
" - title: "Two Columns" image: "template2.jpg" description: "Two-column layout" template: "templates/ckeditor/two_columns.html.twig" template_parameters: default_class: "col-md-6" ``` -------------------------------- ### Run Webpack Encore Build (Yarn) Source: https://github.com/friendsofsymfony/fosckeditorbundle/blob/2.x/docs/installation.rst Execute the Webpack Encore build command using Yarn. ```bash # if you are using Yarn as package manager $ yarn run encore dev ``` -------------------------------- ### Clone Repository and Create Branch Source: https://github.com/friendsofsymfony/fosckeditorbundle/blob/2.x/CONTRIBUTING.md Use these commands to clone the repository and create a new branch for bug fixes. ```bash git clone git@github.com:your-name/IvoryCKEditorBundle.git git checkout -b bug-fix-description ``` -------------------------------- ### Configure Custom Templates Globally Source: https://github.com/friendsofsymfony/fosckeditorbundle/blob/2.x/docs/usage/template.rst Define custom templates, including their images path and template details, in the global configuration. ```yaml # app/config/config.yml fos_ck_editor: default_config: my_config configs: my_config: extraPlugins: "templates" templates: "my_templates" fos_ck_editor: templates: my_templates: imagesPath: "/bundles/mybundle/templates/images" templates: - title: "My Template" image: "image.jpg" description: "My awesome template" html: "

Crazy template :)

" ``` -------------------------------- ### Override PHP Template for CKEditor Widget Source: https://github.com/friendsofsymfony/fosckeditorbundle/blob/2.x/docs/usage/append-javascript.rst Override the default PHP template to append custom JavaScript. This example prevents CKEditor from removing empty spans. ```php extend('FOSCKEditorBundle:Form:ckeditor_widget.html.php') ?> start('ckeditor_widget_extra') ?> CKEDITOR.dtd.$removeEmpty['span'] = false; stop() ?> ``` -------------------------------- ### Override Twig Template for CKEditor Widget Source: https://github.com/friendsofsymfony/fosckeditorbundle/blob/2.x/docs/usage/append-javascript.rst Override the default Twig template to append custom JavaScript. This example configures CKEditor to not remove empty spans. ```twig {# app/Resources/views/Form/ckeditor_widget.html.twig #} {% extends '@FOSCKEditor/Form/ckeditor_widget.html.twig' %} {% block ckeditor_widget_extra %} CKEDITOR.dtd.$removeEmpty['span'] = false; {% endblock %} ``` -------------------------------- ### Define Custom CKEditor Configurations and Toolbars Source: https://context7.com/friendsofsymfony/fosckeditorbundle/llms.txt Configure custom CKEditor instances with specific toolbars and UI colors in the bundle's configuration file. Toolbars can be defined with specific item groups. ```yaml fos_ck_editor: configs: my_config_1: toolbar: "my_toolbar_1" uiColor: "#000000" my_config_2: toolbar: "my_toolbar_2" uiColor: "#ffffff" toolbars: configs: my_toolbar_1: ["@document", "/", "@link", "/", "@tool"] my_toolbar_2: ["@document", "/", "@tool"] items: document: ["Source", "-", "Save", "Preview", "Print"] link: ["Anchor", "Link", "Unlink"] tool: ["Maximize", "ShowBlocks"] ``` -------------------------------- ### Update Bundle Definition (config/bundles.php) Source: https://github.com/friendsofsymfony/fosckeditorbundle/blob/2.x/docs/migration.rst Replace the IvoryCKEditorBundle class with FOSCKEditorBundle in the `config/bundles.php` file. ```php ['all' => true], ]; ``` ```php ['all' => true], ]; ``` -------------------------------- ### Register FOSCKEditorBundle in config/bundles.php (Symfony >= 4.0) Source: https://github.com/friendsofsymfony/fosckeditorbundle/blob/2.x/docs/installation.rst Register the bundle in your bundles.php file if not using Flex or choosing to skip the recipe. ```php return [ // ... FOS\CKEditorBundle\FOSCKEditorBundle::class => ['all' => true], ]; ``` -------------------------------- ### Enable Templates Plugin Globally Source: https://github.com/friendsofsymfony/fosckeditorbundle/blob/2.x/docs/usage/template.rst Enable the 'templates' plugin by adding it to 'extraPlugins' in your global configuration. ```yaml # app/config/config.yml fos_ck_editor: default_config: my_config configs: my_config: extraPlugins: "templates" ``` -------------------------------- ### Update Configuration (config/packages/ivory_ck_editor.yaml) Source: https://github.com/friendsofsymfony/fosckeditorbundle/blob/2.x/docs/migration.rst Change the root configuration key from `ivory_ck_editor` to `fos_ck_editor` in the YAML configuration file. ```yaml # config/packages/ivory_ck_editor.yaml ivory_ck_editor: configs: my_config: toolbar: [ ["Source", "-", "Save"], "/", ["Anchor"], "/", ["Maximize"] ] uiColor: "#000000" filebrowserUploadRoute: "my_route" extraPlugins: "wordcount" # ... ``` ```yaml # config/packages/fos_ck_editor.yaml fos_ck_editor: configs: my_config: toolbar: [ ["Source", "-", "Save"], "/", ["Anchor"], "/", ["Maximize"] ] uiColor: "#000000" filebrowserUploadRoute: "my_route" extraPlugins: "wordcount" # ... ``` -------------------------------- ### Configure Static Filebrowser Route Globally Source: https://github.com/friendsofsymfony/fosckeditorbundle/blob/2.x/docs/usage/file-browse-upload.rst Set static routing options for file browsing globally in the configuration. This defines a fixed route and parameters for file browser requests. ```yaml # app/config/config.yml fos_ck_editor: default_config: my_config configs: my_config: filebrowserBrowseRoute: "my_route" filebrowserBrowseRouteParameters: { slug: "my-slug" } filebrowserBrowseRouteType: 0 ``` -------------------------------- ### Enable RequireJS Support Source: https://context7.com/friendsofsymfony/fosckeditorbundle/llms.txt Enable RequireJS support for applications using AMD module loading, wrapping CKEditor instantiation in a require block. ```yaml # config/packages/fos_ck_editor.yaml fos_ck_editor: require_js: true ``` -------------------------------- ### Configure Default CKEditor Settings Source: https://context7.com/friendsofsymfony/fosckeditorbundle/llms.txt Set the default CKEditor configuration and define custom configurations for file browsing and uploading routes. ```yaml fos_ck_editor: default_config: my_config configs: my_config: filebrowserBrowseRoute: "app_file_browser" filebrowserBrowseRouteParameters: { type: "files" } filebrowserUploadRoute: "app_file_upload" filebrowserUploadRouteParameters: { type: "files" } filebrowserImageBrowseRoute: "app_image_browser" filebrowserImageUploadRoute: "app_image_upload" ``` -------------------------------- ### Implement Dynamic Filebrowser Handler with Closure Source: https://github.com/friendsofsymfony/fosckeditorbundle/blob/2.x/docs/usage/file-browse-upload.rst Use a closure for the filebrowserHandler option to dynamically generate URLs. This provides flexibility by allowing access to dependencies like the router and entity objects. ```php // A blog post... $post = $manager->find($id); $builder->add('field', 'ckeditor', [ 'config' => [ 'filebrowserBrowseHandler' => function (RouterInterface $router) use ($post) { return $router->generate( 'my_route', ['slug' => $post->getSlug()], UrlGeneratorInterface::ABSOLUTE_URL ); }, ], ]); ``` -------------------------------- ### Configure RequireJS for CKEditor Source: https://context7.com/friendsofsymfony/fosckeditorbundle/llms.txt Configure RequireJS paths and shims to properly load CKEditor and its dependencies. ```javascript // RequireJS configuration require.config({ paths: { 'ckeditor': '/bundles/fosckeditor/ckeditor' }, shim: { 'ckeditor': { deps: ['jquery'], exports: 'CKEDITOR' } } }); ``` -------------------------------- ### Configure Custom Filebrowser Options Globally Source: https://github.com/friendsofsymfony/fosckeditorbundle/blob/2.x/docs/usage/file-browse-upload.rst Add custom filebrowser options to be recognized by the bundle globally. This is useful for integrating plugins that introduce new file handling capabilities. ```yaml # app/config/config.yml fos_ck_editor: filebrowsers: - VideoBrowse - VideoUpload ``` -------------------------------- ### Update Configuration (app/config/config.yml) Source: https://github.com/friendsofsymfony/fosckeditorbundle/blob/2.x/docs/migration.rst If not using Symfony Flex, update the root configuration key in `app/config/config.yml` from `ivory_ck_editor` to `fos_ck_editor`. ```yaml # app/config/config.yml ivory_ck_editor: configs: my_config: toolbar: [ ["Source", "-", "Save"], "/", ["Anchor"], "/", ["Maximize"] ] uiColor: "#000000" filebrowserUploadRoute: "my_route" extraPlugins: "wordcount" # ... ``` ```yaml # app/config/config.yml fos_ck_editor: configs: my_config: toolbar: [ ["Source", "-", "Save"], "/", ["Anchor"], "/", ["Maximize"] ] uiColor: "#000000" filebrowserUploadRoute: "my_route" extraPlugins: "wordcount" # ... ``` -------------------------------- ### Register Skin Globally in Configuration Source: https://github.com/friendsofsymfony/fosckeditorbundle/blob/2.x/docs/usage/skin.rst Register a custom skin globally by specifying its name and path in the FOSCKEditorBundle configuration file. The skin path must be an absolute path relative to the web directory. ```yaml fos_ck_editor: default_config: my_config configs: my_config: skin: "skin_name,/bundles/mybundle/skins/skin_name/" ``` -------------------------------- ### Define Custom Toolbars Source: https://github.com/friendsofsymfony/fosckeditorbundle/blob/2.x/docs/usage/toolbar.rst Define custom toolbars named 'my_toolbar_1' and 'my_toolbar_2' in the bundle's configuration. Each toolbar is an array of strips, separated by '/'. ```yaml # config/packages/fos_ck_editor.yaml fos_ck_editor: configs: my_config_1: toolbar: "my_toolbar_1" uiColor: "#000000" # ... my_config_2: toolbar: "my_toolbar_2" uiColor: "#ffffff" # ... my_config_2: toolbar: "my_toolbar_1" uiColor: "#cccccc" toolbars: configs: my_toolbar_1: [ [ "Source", "-", "Save" ], "/", [ "Anchor" ], "/", [ "Maximize" ] ] my_toolbar_2: [ [ "Source" ], "/", [ "Anchor" ], "/", [ "Maximize" ] ] ``` -------------------------------- ### Update Bundle Definition (AppKernel.php) Source: https://github.com/friendsofsymfony/fosckeditorbundle/blob/2.x/docs/migration.rst If not using Symfony Flex, update the bundle registration in `app/AppKernel.php` to use FOSCKEditorBundle. ```php build(); ``` -------------------------------- ### Configure Asynchronous Loading Source: https://context7.com/friendsofsymfony/fosckeditorbundle/llms.txt Configure CKEditor to load asynchronously at the bottom of the page for better performance, using IvoryFormExtraBundle. Set autoload to false and async to true. ```yaml # config/packages/fos_ck_editor.yaml fos_ck_editor: autoload: false async: true ``` -------------------------------- ### Configure Global Toolbar Source: https://github.com/friendsofsymfony/fosckeditorbundle/blob/2.x/docs/usage/toolbar.rst Set the global toolbar configuration to 'full' in your Symfony application's configuration file. ```yaml # config/packages/fos_ck_editor.yaml fos_ck_editor: configs: my_config: toolbar: full ``` -------------------------------- ### Configure Templates in the Widget Source: https://context7.com/friendsofsymfony/fosckeditorbundle/llms.txt Define content templates directly within the form widget using PHP, specifying template details like title, image, description, and HTML structure. ```php $builder->add('content', CKEditorType::class, [ 'config' => [ 'extraPlugins' => 'templates', 'templates' => 'my_template', ], 'templates' => [ 'my_template' => [ 'imagesPath' => '/bundles/mybundle/templates/images', 'templates' => [ [ 'title' => 'My Template', 'image' => 'template.jpg', 'description' => 'My awesome template', 'html' => '

Template content

', ], ], ], ], ]); ``` -------------------------------- ### Commit and Push Fix Source: https://github.com/friendsofsymfony/fosckeditorbundle/blob/2.x/CONTRIBUTING.md After fixing a bug, testing, and documenting, commit and push your changes using these commands. ```bash git commit -m "Bug fix description" git push origin bug-fix-description ``` -------------------------------- ### Enable RequireJS Globally Source: https://github.com/friendsofsymfony/fosckeditorbundle/blob/2.x/docs/usage/require-js.rst Enable RequireJS support for FOSCKEditorBundle by setting the 'require_js' option to true in your global configuration file. ```yaml # app/config/config.yml fos_ck_editor: require_js: true ``` -------------------------------- ### Configure Static Filebrowser Route in Widget Source: https://github.com/friendsofsymfony/fosckeditorbundle/blob/2.x/docs/usage/file-browse-upload.rst Configure static routing options for file browsing within a specific widget. This allows for custom route generation for individual CKEditor instances. ```php $builder->add('field', 'ckeditor', [ 'config' => [ 'filebrowserBrowseRoute' => 'my_route', 'filebrowserBrowseRouteParameters' => ['slug' => 'my-slug'], 'filebrowserBrowseRouteType' => UrlGeneratorInterface::ABSOLUTE_URL, ], ]); ``` -------------------------------- ### Register CKEditor Plugin Globally (YAML) Source: https://github.com/friendsofsymfony/fosckeditorbundle/blob/2.x/docs/usage/plugin.rst Configure CKEditor to load an extra plugin globally by specifying its path and filename in the app/config/config.yml. ```yaml # app/config/config.yml fos_ck_editor: default_config: my_config configs: my_config: extraPlugins: "wordcount" plugins: wordcount: path: "/bundles/mybundle/wordcount/" # with trailing slash filename: "plugin.js" ``` -------------------------------- ### Update Service Definition Source: https://github.com/friendsofsymfony/fosckeditorbundle/blob/2.x/docs/migration.rst Replace service IDs prefixed with `ivory_ck_editor` to `fos_ck_editor` when fetching services from the container. ```php $this->get('ivory_ck_editor.form.type'); ``` ```php $this-get('fos_ck_editor.form.type'); ``` -------------------------------- ### Register FOSCKEditorBundle in app/AppKernel.php (Symfony < 4.0) Source: https://github.com/friendsofsymfony/fosckeditorbundle/blob/2.x/docs/installation.rst Register the bundle in your AppKernel.php file for older Symfony versions. ```php class AppKernel extends Kernel { public function registerBundles() { $bundles = [ new FOS\CKEditorBundle\FOSCKEditorBundle(), // ... ]; // ... } } ``` -------------------------------- ### Enable Global Inline Editing (YAML) Source: https://github.com/friendsofsymfony/fosckeditorbundle/blob/2.x/docs/usage/inline.rst Set `inline: true` in `app/config/config.yml` to enable inline editing for all CKEditor instances globally. ```yaml fos_ck_editor: inline: true ``` -------------------------------- ### Require FOSCKEditorBundle via Composer Source: https://github.com/friendsofsymfony/fosckeditorbundle/blob/2.x/docs/installation.rst Use this command to add the bundle to your project's dependencies. ```bash $ composer require friendsofsymfony/ckeditor-bundle ``` -------------------------------- ### Enable Asynchronous CKEditor Loading Globally Source: https://github.com/friendsofsymfony/fosckeditorbundle/blob/2.x/docs/usage/loading.rst Configure the bundle globally to disable automatic loading and enable asynchronous rendering of CKEditor JavaScript. This requires the IvoryFormExtraBundle. ```yaml # app/config/config.yml fos_ck_editor: autoload: false async: true ``` -------------------------------- ### Define Global Styles in YAML Source: https://github.com/friendsofsymfony/fosckeditorbundle/blob/2.x/docs/usage/style.rst Configure custom styles globally in your `config.yml` file. This approach is useful for applying a consistent set of styles across your application. ```yaml # app/config/config.yml fos_ck_editor: default_config: my_config configs: my_config: stylesSet: "my_styles" styles: my_styles: - { name: "Blue Title", element: "h2", styles: { color: "Blue" }} - { name: "CSS Style", element: "span", attributes: { class: "my_style" }} - { name: "Widget Style", type: widget, widget: "my_widget", attributes: { class: "my_widget_style" }} ``` -------------------------------- ### Use Dedicated Twig/PHP Template Globally Source: https://github.com/friendsofsymfony/fosckeditorbundle/blob/2.x/docs/usage/template.rst Configure templates to use dedicated Twig or PHP files for their HTML content, specifying the template path and optional parameters. ```yaml # app/config/config.yml fos_ck_editor: default_config: my_config configs: my_config: extraPlugins: "templates" templates: "my_templates" fos_ck_editor: templates: my_templates: imagesPath: "/bundles/mybundle/templates/images" templates: - title: "My Template" image: "image.jpg" description: "My awesome template" template: "AppBundle:CKEditor:template.html.twig" template_parameters: foo: bar ``` -------------------------------- ### Configure Custom jQuery Adapter Path Globally Source: https://github.com/friendsofsymfony/fosckeditorbundle/blob/2.x/docs/usage/jquery.rst Specify a custom path for the jQuery adapter globally in your application's configuration. Paths are relative to the web directory. ```yaml fos_ck_editor: jquery_path: your/own/jquery.js ``` -------------------------------- ### Update Composer Dependencies Source: https://github.com/friendsofsymfony/fosckeditorbundle/blob/2.x/docs/migration.rst Remove the old bundle and require the new one using Composer. ```bash composer remove egeloen/ckeditor-bundle composer require friendsofsymfony/ckeditor-bundle ``` -------------------------------- ### Register Custom Filebrowser Options Source: https://context7.com/friendsofsymfony/fosckeditorbundle/llms.txt Register custom filebrowser options for plugins that require additional browse/upload capabilities, such as video plugins. This is done in the bundle configuration. ```yaml # config/packages/fos_ck_editor.yaml fos_ck_editor: filebrowsers: - VideoBrowse - VideoUpload configs: my_config: filebrowserVideoBrowseRoute: "app_video_browser" filebrowserVideoUploadRoute: "app_video_upload" ``` -------------------------------- ### Enable jQuery Adapter Globally Source: https://github.com/friendsofsymfony/fosckeditorbundle/blob/2.x/docs/usage/jquery.rst Enable the CKEditor jQuery adapter globally in your application's configuration file. ```yaml fos_ck_editor: jquery: true ``` -------------------------------- ### Configure Plugins Directly in the Form Widget Source: https://context7.com/friendsofsymfony/fosckeditorbundle/llms.txt Set up CKEditor plugins and their configurations directly within the form widget definition in PHP. ```php $builder->add('content', CKEditorType::class, [ 'config' => [ 'extraPlugins' => 'wordcount', ], 'plugins' => [ 'wordcount' => [ 'path' => '/bundles/mybundle/ckeditor/plugins/wordcount/', 'filename' => 'plugin.js', ], ], ]); ``` -------------------------------- ### Configure JSON encode options Source: https://github.com/friendsofsymfony/fosckeditorbundle/blob/2.x/docs/usage/json-builder.rst Set custom JSON encode options using setJsonEncodeOptions. Retrieve the current options with getJsonEncodeOptions. ```php $builder->setJsonEncodeOptions(JSON_FORCE_OBJECT); $jsonEncodeOptions = $builder->getJsonEncodeOptions(); ``` -------------------------------- ### Rebase and Push Branch Source: https://github.com/friendsofsymfony/fosckeditorbundle/blob/2.x/CONTRIBUTING.md If your branch conflicts with the master branch, rebase and force push your changes. ```bash git remote add upstream git@github.com:FriendsOfSymfony/FOSCKEditorBundle.git git pull --rebase upstream master git push origin bug-fix-description -f ``` -------------------------------- ### Register Skin in Widget Configuration Source: https://github.com/friendsofsymfony/fosckeditorbundle/blob/2.x/docs/usage/skin.rst Register a custom skin for a specific CKEditor widget by passing the skin name and path within the widget's configuration options. The skin path must be an absolute path relative to the web directory. ```php $builder->add('field', 'ckeditor', [ 'config' => ['skin' => 'skin_name,/bundles/mybundle/skins/skin_name/'], ]); ``` -------------------------------- ### Enable jQuery Adapter Integration Source: https://context7.com/friendsofsymfony/fosckeditorbundle/llms.txt Enable the jQuery adapter for applications that rely on jQuery, wrapping CKEditor instantiation in jQuery's document ready block. ```yaml # config/packages/fos_ck_editor.yaml fos_ck_editor: jquery: true jquery_path: "bundles/fosckeditor/adapters/jquery.js" # or custom path ``` -------------------------------- ### Squash Commits Source: https://github.com/friendsofsymfony/fosckeditorbundle/blob/2.x/CONTRIBUTING.md If you have reworked your patch, squash multiple commits into a single one using interactive rebase. ```bash git rebase -i HEAD~3 ``` -------------------------------- ### Configure Custom Filebrowser Options in Widget Source: https://github.com/friendsofsymfony/fosckeditorbundle/blob/2.x/docs/usage/file-browse-upload.rst Configure custom filebrowser options on a per-widget basis. This allows for specific file handling settings for individual CKEditor instances. ```php $builder->add('field', 'ckeditor', [ 'filebrowsers' => [ 'VideoUpload', 'VideoBrowse', ], ]); ``` -------------------------------- ### Set CKEditor Base and JS Paths in Symfony Config Source: https://context7.com/friendsofsymfony/fosckeditorbundle/llms.txt Configure the `base_path` and `js_path` in `fos_ck_editor.yaml` to point to the location where CKEditor assets are copied by Webpack Encore. ```yaml fos_ck_editor: base_path: "build/ckeditor" js_path: "build/ckeditor/ckeditor.js" ``` -------------------------------- ### Define Reusable CKEditor Configuration Source: https://github.com/friendsofsymfony/fosckeditorbundle/blob/2.x/docs/usage/config.rst Define a custom CKEditor configuration named 'my_config' in your application's configuration file. This configuration can include various CKEditor options like toolbar, UI color, plugins, and more. The first configuration defined becomes the default if none is explicitly set. ```yaml # app/config/config.yml fos_ck_editor: configs: my_config: toolbar: [ ["Source", "-", "Save"], "/", ["Anchor"], "/", ["Maximize"] ] uiColor: "#000000" filebrowserUploadRoute: "my_route" extraPlugins: "wordcount" # ... ``` -------------------------------- ### Use Built-in Toolbar Presets in PHP Source: https://context7.com/friendsofsymfony/fosckeditorbundle/llms.txt Integrate CKEditor into a Symfony form using the CKEditorType, specifying a built-in toolbar preset like 'full'. ```php $builder->add('content', CKEditorType::class, [ 'config' => ['toolbar' => 'full'], // Options: full, standard, basic ]); ``` -------------------------------- ### Define a Global Default CKEditor Configuration Source: https://github.com/friendsofsymfony/fosckeditorbundle/blob/2.x/docs/usage/config.rst Set a global default configuration for all CKEditor instances by using the 'default_config' node in your application's configuration. This eliminates the need to specify 'config_name' for every instance if they all share the same base configuration. ```yaml # app/config/config.yml fos_ck_editor: default_config: my_config configs: my_config: # ... ``` -------------------------------- ### Render CKEditor Form and Load JavaScript Asynchronously Source: https://context7.com/friendsofsymfony/fosckeditorbundle/llms.txt Render the form and its widgets in a Twig template, then load CKEditor and its deferred JavaScript at the bottom of the page. ```twig {# In your Twig template, render form JavaScript after CKEditor is loaded #} {{ form_start(form) }} {{ form_widget(form) }} {{ form_end(form) }} {# Load CKEditor at the bottom of the page #} {# Render deferred form JavaScript #} {{ form_javascript(form) }} ``` -------------------------------- ### Register Custom Filebrowsers in Widget Source: https://context7.com/friendsofsymfony/fosckeditorbundle/llms.txt Register custom filebrowsers directly within a form widget configuration, specifying the filebrowser types and their corresponding routes. ```php $builder->add('content', CKEditorType::class, [ 'filebrowsers' => ['VideoBrowse', 'VideoUpload'], 'config' => [ 'filebrowserVideoBrowseRoute' => 'app_video_browser', 'filebrowserVideoUploadRoute' => 'app_video_upload', ], ]); ``` -------------------------------- ### Configure Asynchronous Loading in Form Widget Source: https://context7.com/friendsofsymfony/fosckeditorbundle/llms.txt Configure asynchronous loading for CKEditor directly within a form widget, setting autoload to false and async to true. ```php $builder->add('content', CKEditorType::class, [ 'autoload' => false, 'async' => true, ]); ``` -------------------------------- ### Configure PHP Templating Form Resources Source: https://github.com/friendsofsymfony/fosckeditorbundle/blob/2.x/docs/usage/append-javascript.rst Register the custom PHP template directory in the application's configuration to override the default CKEditor widget template. ```yaml # app/config/config.yml framework: templating: form: resources: - "::Form" ``` -------------------------------- ### Enable Templates Plugin in Widget Source: https://github.com/friendsofsymfony/fosckeditorbundle/blob/2.x/docs/usage/template.rst Enable the 'templates' plugin for a specific form field by configuring it within the widget options. ```php $builder->add('field', 'ckeditor', [ 'config' => [ 'extraPlugins' => 'templates', ], ]); ``` -------------------------------- ### Use Dedicated Twig/PHP Template in Widget Source: https://github.com/friendsofsymfony/fosckeditorbundle/blob/2.x/docs/usage/template.rst Configure a widget to use dedicated Twig or PHP templates for its content, including the template path and optional parameters. ```php $builder->add('field', 'ckeditor', [ 'config' => [ 'extraPlugins' => 'templates', 'templates' => 'my_template', ], 'templates' => [ 'my_template' => [ 'imagesPath' => '/bundles/mybundle/templates/images', 'templates' => [ [ 'title' => 'My Template', 'image' => 'images.jpg', 'description' => 'My awesome template', 'template' => 'AppBundle:CKEditor:template.html.twig', 'template_parameters' => ['foo' => 'bar'], ], // ... ], ], ], ]); ``` -------------------------------- ### Use Predefined CKEditor Configuration in Form Source: https://context7.com/friendsofsymfony/fosckeditorbundle/llms.txt Apply a predefined configuration to a CKEditor form field by specifying 'config_name'. Individual options can still be overridden. ```php // Use the predefined configuration in your form $builder->add('content', CKEditorType::class, [ 'config_name' => 'my_config', ]); // Override specific options from the predefined config $builder->add('summary', CKEditorType::class, [ 'config_name' => 'my_config', 'config' => ['uiColor' => '#ffffff'], ]); ``` -------------------------------- ### Enable Asynchronous CKEditor Loading in Widget Source: https://github.com/friendsofsymfony/fosckeditorbundle/blob/2.x/docs/usage/loading.rst Configure a specific form field for asynchronous CKEditor loading. This disables autoloading and enables async rendering, requiring IvoryFormExtraBundle. ```php $builder->add('field', 'ckeditor', [ 'autoload' => false, 'async' => true, ]); ``` -------------------------------- ### Define Reusable CKEditor Configurations Source: https://context7.com/friendsofsymfony/fosckeditorbundle/llms.txt Define named configurations in fos_ck_editor.yaml to reuse settings across multiple CKEditor instances. These configurations can be overridden at the form field level. ```yaml # config/packages/fos_ck_editor.yaml fos_ck_editor: default_config: my_config configs: my_config: toolbar: full uiColor: "#000000" language: en filebrowserUploadRoute: "app_file_upload" extraPlugins: "wordcount" minimal_config: toolbar: basic uiColor: "#f5f5f5" removePlugins: "elementspath" ``` -------------------------------- ### Configure CKEditor File Browser Routes in Form Source: https://context7.com/friendsofsymfony/fosckeditorbundle/llms.txt Configure CKEditor file browser routes directly within a form widget, specifying routes and parameters. Supports static and dynamic route generation. ```php use Symfony\Component\Routing\Generator\UrlGeneratorInterface; // Static routing in form widget $builder->add('content', CKEditorType::class, [ 'config' => [ 'filebrowserBrowseRoute' => 'app_file_browser', 'filebrowserBrowseRouteParameters' => ['slug' => 'my-slug'], 'filebrowserBrowseRouteType' => UrlGeneratorInterface::ABSOLUTE_URL, 'filebrowserUploadRoute' => 'app_file_upload', ], ]); // Dynamic routing with handler closures $post = $entityManager->find(Post::class, $id); $builder->add('content', CKEditorType::class, [ 'config' => [ 'filebrowserBrowseHandler' => function (RouterInterface $router) use ($post) { return $router->generate( 'app_file_browser', ['post_id' => $post->getId()], UrlGeneratorInterface::ABSOLUTE_URL ); }, ], ]); ``` -------------------------------- ### Configure Editor Language Source: https://context7.com/friendsofsymfony/fosckeditorbundle/llms.txt Configure the CKEditor language explicitly or allow the bundle to auto-detect the language from the request locale. ```yaml # config/packages/fos_ck_editor.yaml fos_ck_editor: default_config: my_config configs: my_config: language: "en" ``` -------------------------------- ### Configure Custom Templates in Widget Source: https://github.com/friendsofsymfony/fosckeditorbundle/blob/2.x/docs/usage/template.rst Define custom templates for a specific form field within the widget configuration, including images path and template details. ```php $builder->add('field', 'ckeditor', [ 'config' => [ 'extraPlugins' => 'templates', 'templates' => 'my_template', ], 'templates' => [ 'my_template' => [ 'imagesPath' => '/bundles/mybundle/templates/images', 'templates' => [ [ 'title' => 'My Template', 'image' => 'images.jpg', 'description' => 'My awesome template', 'html' => '

Crazy template :)

', ], // ... ], ], ], ]); ``` -------------------------------- ### Override Parts of a Defined CKEditor Configuration Source: https://github.com/friendsofsymfony/fosckeditorbundle/blob/2.x/docs/usage/config.rst When using a defined configuration ('my_config'), you can selectively override specific options, such as 'uiColor', using the 'config' option. This allows for minor adjustments without redefining the entire configuration. ```php $builder->add('field', 'ckeditor', [ 'config_name' => 'my_config', 'config' => ['uiColor' => '#ffffff'], ]); ``` -------------------------------- ### Configure Widget Toolbar Source: https://github.com/friendsofsymfony/fosckeditorbundle/blob/2.x/docs/usage/toolbar.rst Set the toolbar configuration for a specific CKEditor widget directly within the form builder. ```php $builder->add('field', 'ckeditor', [ 'config' => ['toolbar' => 'full'], ]); ``` -------------------------------- ### Configure Webpack Encore for CKEditor Assets Source: https://context7.com/friendsofsymfony/fosckeditorbundle/llms.txt Configure Webpack Encore to copy CKEditor 4 files from `node_modules` to the appropriate build directory for asset management. ```javascript var Encore = require('@symfony/webpack-encore'); Encore .copyFiles([ {from: './node_modules/ckeditor4/', to: 'build/ckeditor/[path][name].[ext]', pattern: /\.(js|css)$/, includeSubdirectories: false}, {from: './node_modules/ckeditor4/adapters', to: 'build/ckeditor/adapters/[path][name].[ext]'}, {from: './node_modules/ckeditor4/lang', to: 'build/ckeditor/lang/[path][name].[ext]'}, {from: './node_modules/ckeditor4/plugins', to: 'build/ckeditor/plugins/[path][name].[ext]'}, {from: './node_modules/ckeditor4/skins', to: 'build/ckeditor/skins/[path][name].[ext]'}, {from: './node_modules/ckeditor4/vendor', to: 'build/ckeditor/vendor/[path][name].[ext]'} ]); ``` -------------------------------- ### Enable RequireJS Per Widget Source: https://github.com/friendsofsymfony/fosckeditorbundle/blob/2.x/docs/usage/require-js.rst Enable RequireJS support for a specific CKEditor widget by passing the 'require_js' option set to true during its creation. ```php $builder->add('field', 'ckeditor', ['require_js' => true]); ``` -------------------------------- ### Enable Global Input Synchronization Source: https://github.com/friendsofsymfony/fosckeditorbundle/blob/2.x/docs/usage/textarea-sync.rst To synchronize textarea values globally, set 'input_sync' to true in your app/config/config.yml. This ensures all CKEditor instances update their associated textareas. ```yaml # app/config/config.yml fos_ck_editor: input_sync: true ``` -------------------------------- ### Configure Twig Form Themes Source: https://github.com/friendsofsymfony/fosckeditorbundle/blob/2.x/docs/installation.rst Add the CKEditor Twig form theme to your configuration to enable the widget. This is not required if using Symfony Flex with the recipe. ```yaml # Symfony 2/3: app/config/config.yml # Symfony 4: config/packages/twig.yaml twig: form_themes: - '@FOSCKEditor/Form/ckeditor_widget.html.twig' ``` -------------------------------- ### Configure CKEditor Default Language Source: https://context7.com/friendsofsymfony/fosckeditorbundle/llms.txt Set the default language for CKEditor instances. This configuration is applied globally unless overridden. ```yaml fos_ck_editor: configs: my_config: language: fr ``` -------------------------------- ### Configure CKEditor Skin in Form Widget Source: https://context7.com/friendsofsymfony/fosckeditorbundle/llms.txt Configure the CKEditor skin directly within a form widget, specifying the skin name and its path. ```php $builder->add('content', CKEditorType::class, [ 'config' => [ 'skin' => 'moono-lisa,/bundles/mybundle/ckeditor/skins/moono-lisa/', ], ]); ``` -------------------------------- ### Enable Widget-Specific Input Synchronization Source: https://github.com/friendsofsymfony/fosckeditorbundle/blob/2.x/docs/usage/textarea-sync.rst Alternatively, enable input synchronization for a specific CKEditor widget by setting 'input_sync' to true during its definition in a form builder. ```php $builder->add('field', 'ckeditor', ['input_sync' => true]); ``` -------------------------------- ### Append a set of values Source: https://github.com/friendsofsymfony/fosckeditorbundle/blob/2.x/docs/usage/json-builder.rst Use setValues to append multiple values to the builder. Values are appended without escaping control by default. ```php $builder->setValues(['foo' => ['bar']]); ``` ```php $builder->setValues(['bar'], '[foo]'); ``` -------------------------------- ### Use a Defined CKEditor Configuration in a Form Source: https://github.com/friendsofsymfony/fosckeditorbundle/blob/2.x/docs/usage/config.rst Apply a previously defined reusable configuration ('my_config') to a CKEditor form field using the 'config_name' option. This avoids duplicating configuration settings across multiple form builders. ```php $builder->add('field', 'ckeditor', [ 'config_name' => 'my_config', ]); ``` -------------------------------- ### Define Custom Styles Globally Source: https://context7.com/friendsofsymfony/fosckeditorbundle/llms.txt Define custom styles that will appear in the CKEditor Styles dropdown menu. These are configured in the bundle's YAML settings. ```yaml # config/packages/fos_ck_editor.yaml fos_ck_editor: default_config: my_config configs: my_config: stylesSet: "my_styles" styles: my_styles: - { name: "Blue Title", element: "h2", styles: { color: "Blue" } } - { name: "CSS Style", element: "span", attributes: { class: "my_style" } } - { name: "Widget Style", type: "widget", widget: "my_widget", attributes: { class: "my_widget_style" } } ``` -------------------------------- ### Exclude Paths During CKEditor Extraction Source: https://github.com/friendsofsymfony/fosckeditorbundle/blob/2.x/docs/usage/ckeditor.rst Prevent specific directories like 'samples' or 'adapters' from being extracted from the downloaded CKEditor ZIP archive. ```bash $ php bin/console ckeditor:install --exclude=samples --exclude=adapters ``` -------------------------------- ### Override Built-in Toolbar Items Source: https://github.com/friendsofsymfony/fosckeditorbundle/blob/2.x/docs/usage/toolbar.rst Override specific items within built-in toolbar configurations, such as 'full.colors' or 'full.document', to customize them without redefining the entire toolbar. ```yaml fos_ck_editor: configs: my_config: toolbar: "full" toolbars: items: full.colors: [ "TextColor", "BGColor" ] full.document: [ "Source", "-", "Preview", "Print" ] ```