Skip to content

Custom themes - allows the definitions of more tinymce themes than just simple & advanced #24

Merged
merged 3 commits into from Mar 19, 2012

4 participants

@hoppinger

given the following yml config:

stfalcon_tinymce:
    textarea_class: tinymce
    include_jquery: false
    theme:
        simple:
            mode: "textareas"
            theme: "advanced"
            theme_advanced_buttons1: "bold,italic,underline,seperator,link,unlink,|,spellchecker"
            theme_advanced_buttons2: ""
            theme_advanced_buttons3: ""
            theme_advanced_toolbar_location: "top"
            theme_advanced_toolbar_align: "left"
            theme_advanced_statusbar_location: ""
            plugins: "paste,spellchecker"
            paste_auto_cleanup_on_paste: true
            spellchecker_languages: "+English=en,Dutch=nl"
        advanced:
            theme: "advanced"
            plugins: "table,advhr,advimage,advlink,media,paste,fullscreen,xhtmlxtras,spellchecker"
            theme_advanced_buttons1: "bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,forecolor,backcolor,|,hr,removeformat,|,sub,sup,|,spellchecker"
            theme_advanced_buttons2: "cut,copy,paste,pastetext,pasteword,|,bullist,numlist,|,undo,redo,|,link,unlink,anchor,image,cleanup,code,|,tablecontrols"
            theme_advanced_buttons3: ""
            theme_advanced_toolbar_location: "top"
            theme_advanced_toolbar_align: "left"
            theme_advanced_statusbar_location: "bottom"
            theme_advanced_resizing: true
            paste_auto_cleanup_on_paste: true
            spellchecker_languages : "+English=en,Dutch=nl"
        medium:
            mode: "textareas"
            theme: "advanced"
            plugins: "table,advhr,advlink,paste,xhtmlxtras,spellchecker"
            theme_advanced_buttons1: "bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,forecolor,backcolor,|,hr,removeformat,|,sub,sup,|,spellchecker"
            theme_advanced_buttons2: "cut,copy,paste,pastetext,pasteword,|,bullist,numlist,|,undo,redo,|,link,unlink,anchor,cleanup,code,|,tablecontrols"
            theme_advanced_buttons3: ""
            theme_advanced_toolbar_location: "top"
            theme_advanced_toolbar_align: "left"
            theme_advanced_statusbar_location: ""
            paste_auto_cleanup_on_paste: true
            spellchecker_languages: "+English=en,Dutch=nl"

you can do the following in a form field definition to use a defined theme other than 'simple' or '

$builder->add('description', 'tinymce',     array(
        'label'     => 'Description', 
        'required'  => false,
        'theme' => 'medium',
));

the 'simple' theme is still used by default (if no theme was explicitly specified) and also if the explicitly specified theme is not defined.

@stfalcon
Owner

nice! pls added this info to README

@iamjochem iamjochem add some info to README.md about the changes that allow dfor definiti…
…on of additional themes (beyond 'simple' and 'advanced'
6d04195
@hoppinger

iamjochem made a quick change to the README

@stfalcon
Owner

ok. pls resolved conflicts with HEAD rev

@stfalcon stfalcon merged commit 6d04195 into stfalcon:master Mar 19, 2012
@ardianys

I can't select custom theme in my installation

I got this error

The option "theme" does not exist 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.