Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ability to set toolbars for RichTextArea in construct #44

Closed
mboynes opened this issue Oct 8, 2013 · 1 comment
Closed

Add ability to set toolbars for RichTextArea in construct #44

mboynes opened this issue Oct 8, 2013 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@mboynes
Copy link
Contributor

mboynes commented Oct 8, 2013

We can currently modify the Fieldmanager_RichTextArea toolbars via filter, which works fairly well, but produces a lot of code. It would be nice to allow one to set the toolbars when creating the object, via the options array. For instance (toolbars exaggeratively brief),

$fm = new Fieldmanager_RichTextArea( array(
    'name' => 'my_richtextarea',
    'toolbar1' => array( 'bold', 'italic' ),
    'toolbar2' => array( 'formatselect' ),
    'toolbar3' => array( 'bullist' ),
    'toolbar4' => array( 'numlist' )
) );

We could also setup a few preset toolbar collections. For instance, 'toolbar_preset' => 'basic' might provide a very simple toolbar set, while (the default) 'toolbar_preset' => 'advanced' might provide a more complex one. For usage in the sidebar, 'toolbar_preset' => 'sidebar' could provide an especially narrow set that won't break the sidebar's width. And so on.

@danielbachhuber
Copy link
Contributor

For reference, I went this route for my setup:

$mce_toolbar = 'bold,italic,strikethrough,bullist,numlist,blockquote,add_media,link,unlink,formatselect';
$publication_guidelines = new Fieldmanager_RichTextArea( __( 'Guidelines for Publication' ), array() );
$publication_guidelines->init_options = array(
    'height'     => 50,
    'toolbar1'   => $mce_toolbar,
    'toolbar2'   => '',
    'toolbar3'   => '',
    );

@mboynes mboynes self-assigned this Sep 1, 2014
@mboynes mboynes closed this as completed in 79bf73d Sep 2, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants