Closed gabiudrescu closed 6 years ago
dunno if we should add it because I don't know if it works out of the box. which brings me to the question: what are the criteria of acceptance for adding stuff to our recommendation repo? but this is for another issue.
Personally, I used https://symfony.com/doc/master/bundles/IvoryCKEditorBundle/installation.html for my projects. Enabling it in Sylius is straightforward:
<?php
declare(strict_types=1);
namespace AdminBundle\Form\Extension;
use Ivory\CKEditorBundle\Form\Type\CKEditorType;
use Sylius\Bundle\ProductBundle\Form\Type\ProductTranslationType;
use Symfony\Component\Form\AbstractTypeExtension;
use Symfony\Component\Form\FormBuilderInterface;
final class ProductTranslationTypeExtension extends AbstractTypeExtension
{
/**
* {@inheritdoc}
*/
public function buildForm(FormBuilderInterface $builder, array $options): void
{
$builder
->remove('description')
->add('description', CKEditorType::class, [
'required' => false,
'label' => 'sylius.form.product.description',
])
;
}
/**
* {@inheritdoc}
*/
public function getExtendedType(): string
{
return ProductTranslationType::class;
}
}
Maybe we can create some basic tuts in the SyliusGoose with the markdown files where we will put simple "How to?" like this?
Or a simple plugin that defines some of these extensions for the user which can be turned on/off by setting some config parameters :-) But ja, that takes more time than a simple tutorial.
I find TinyMCE not the best, it also seems to be using an API key. CKEditor seems better to me.
Yeap, we are using it a lot with our CmsPlugin and for now, we are quite satisfied with it.
Added the StepByStep tutorial here - https://github.com/friendsofsylius/SyliusGoose/blob/master/StepByStep/WYSIWYG_EDITOR_IN_ANY_FORM.md
Available here: https://github.com/Lead-Ext/LeadExtWysiwygEditorPlugin
Often asked in Sylius slack (support) channel.