0
votes

I am working in a landing-page and newsletter manager for a blog. We are using symfony with tinymce bundle(stfalcon) for wysiwyg editor.

The customer wants to copy paste the full structure of a landing-page or newsletter from a template designer (or create with Mailchimp) directly into TinyMce, so according with the documentation, I should add the fullpage plugin in the config of symfony.

The problem is that we want to keep the layout we have designed for the blog and keep only the fullpage plugin active in landing Controller or Newsletter Controller.

I have found this tutorial, but is for symfony 1.4, and we are working actually in 2.8 (yes, I know we should update to 3.4 but is legacy code)

There is any way to load the Tinymce plugin on render the form?

1

1 Answers

1
votes

Finally I have find the answer (I left here for documentation),

You can create as many themes in Symfony config.yml as you like, so first is duplicate the desired theme and add the plugins you need:

advanced:
            convert_urls: false
            file_browser_callback:  'elFinderBrowser'
            plugins:
                - "advlist autolink lists link image charmap print preview hr anchor pagebreak"
                - "searchreplace wordcount visualblocks visualchars code fullscreen"
                - "insertdatetime media nonbreaking save table contextmenu directionality"
                - "emoticons template paste textcolor"
            toolbar1: "insertfile undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image | print preview media | forecolor backcolor | stfalcon | example"
            image_advtab: true
            templates: "/admin/newsletter/templates/templatelist"
            entity_encoding : "raw"

    fullpage:
        convert_urls: false
        file_browser_callback:  'elFinderBrowser'
        plugins:
            - "advlist autolink lists link image charmap print preview hr anchor pagebreak"
            - "searchreplace wordcount visualblocks visualchars code fullscreen fullpage"
            - "insertdatetime media nonbreaking save table contextmenu directionality"
            - "emoticons template paste textcolor"
        toolbar1: "insertfile undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image | print preview media | forecolor backcolor | stfalcon | example"
        image_advtab: true
        templates: "/admin/newsletter/templates/templatelist"
        entity_encoding : "raw"`

After that, in the controller, change the theme you are rendering tinymce with:

->add('content', 'textarea', [
                'label'             => 'Contenido',
                'required'          => false,
                'attr'              => ['class' => 'tinymce', 'data-theme' => 'fullpage']