- Can I use this bundle in Laravel? If not, what’s the best alternative?
- No, this bundle is designed for Symfony2 and won’t work in Laravel without significant refactoring. For Laravel, consider using the standalone Summernote library via CDN or a dedicated package like `spatie/laravel-medialibrary` for image uploads paired with a custom Summernote integration.
- What Laravel version does this bundle support?
- This bundle does not support Laravel—it’s built for Symfony2, which is end-of-life. If you’re using Laravel, avoid this package entirely and opt for a Laravel-specific solution or a CDN-based Summernote integration.
- How do I configure the toolbar and plugins in this bundle?
- Configure toolbars and plugins via YAML in `config.yml` under `adn_summernote`. Define `toolbar` arrays (e.g., `['style', ['style']]`) and list plugins like `video` or `elfinder` under `plugins`. Example: `plugins: [video]` and `toolbar: [['bold'], ['italic']]`.
- Does this bundle support image uploads from the editor?
- Yes, enable image uploads by setting `upload_images: true` in the YAML config. Specify `max_upload_size` (e.g., `1048576` for 1MB) and define a custom `image_upload_route` to handle file processing. The bundle will replace base64 pasted images with uploaded files.
- What PHP versions are compatible with this bundle?
- The bundle targets PHP 5.5+ (Symfony2’s supported range). If you’re using PHP 8.x, expect deprecation warnings or compatibility issues. Test thoroughly, as Symfony2’s EOL status means no active PHP 8.x support.
- How do I integrate this bundle with Symfony forms?
- Extend Symfony’s `AbstractType` to use the bundle’s form field. The bundle likely provides a `SummernoteType`—include it in your form builder (e.g., `$builder->add('content', SummernoteType::class)`). Ensure your Twig templates render the form correctly with the configured selector (e.g., `.summernote`).
- Are there any known issues with asset loading (JS/CSS) in production?
- Assets (jQuery, Bootstrap, Font Awesome) are included by default unless disabled in config (`include_jquery: false`). In production, ensure Symfony’s asset pipeline (Assetic or Webpack Encore) is configured to merge and minify these files. Conflicts may arise if other bundles load duplicate dependencies.
- Can I customize the editor’s width and height dynamically?
- Yes, set `width` and `height` in the YAML config (e.g., `width: 800`, `height: 500`). For dynamic sizing, override these values in Twig using data attributes or JavaScript after page load. The bundle applies static dimensions by default.
- Is there a way to disable jQuery/Bootstrap inclusion if already loaded?
- Yes, set `include_jquery: false` and `include_bootstrap: false` in the config to skip loading these dependencies. This is useful if your project already includes jQuery or Bootstrap via other bundles or CDN links.
- How do I handle errors if the bundle fails to load in Symfony2?
- Check the Symfony logs (`app/logs/prod.log`) for errors. Common issues include missing dependencies (e.g., Twig, Doctrine) or incorrect YAML config. Verify the bundle is registered in `AppKernel.php` and that all required Composer dependencies are installed. If using PHP 8.x, downgrade to PHP 5.6–7.4 for compatibility.