Display different set of buttons for different instances of tiny mce - tinymce

I'm adding text area dynamically, which will be instance of tine mce. In a page, I will be adding text area for say heading, paragraph etc. For heading, I need to have only b,I,U and align buttons displayed, also for p, I need a different set of buttons.
Is it possible ?
How to do if possible ?

As far as i can see you want to have different instances of tinymce on a page.
All you need to do is to initialize each tinymce instance with an own configuration.
you can

Related

Why does the same exact material-ui text field's height shrink in one spot and not another?

I am using the Material UI Text Field component as a search bar in my app. On one of the pages, I have it in 2 spots, one on the outside of the page, and another inside my DevExtreme Data Grid.
See here
For whatever reason, this shrinks the search bar, despite it being the exact same component being used in 2 spots.
My question is, what causes MUI to shrink the height of their text input field so that I can fix it accordingly inside of my data grid?
I've tried adjusting line-height, padding, margin's, etc all inside the data grid, unfortunately to no avail. The only thing I've noticed is that deep in the inspector tool, the shrunken search bar has a height of 1.435em, and checking that off will cause the search bar to correct itself to the standard height.

Setting Button's Size in TinyMCE 4

I'm new with TinyMCE and trying to set the size of some of the buttons in the editor to small and some others' to medium, in TinyMCE 4.
I know about this property toolbar_items_size but this sets all the button's size small or medium. Instead, I'm trying to set the size property of the buttons in editor.buttons[] manually after the buttons get registered with the editor but before the theme gets initialized since the theme uses Factory.create() to create buttons & that sets class btn-<size> to the button, which sets its size.
I've looked into TinyMCE's code too but have not able to figure out a way to do so. Also, I've observed that all the editor's events get fired after the theme gets initialized, like BeforeSetContent,..etc.
I'm using modern theme.
Is there some way to achieve this?
Thanks.
TinyMCE simply does not support what you are trying to do - the buttons on the toolbar(s) are a uniform size. You can pick that uniform size (as you reference) but you can't mix buttons of different sizes on the toolbar.

How to use customized tool bar in tiny mce?

I'm using tiny mce in one of my projects and client do not want to use the Horizontal tool bar of tiny mce. He wants a centralized custom tool bar from where user can control all the properties like text color, type of text, size, back grounds and every thing that is needed to do while designing a web page using templates. I configured the mce instance with out its default tool bar and controlled the properties from the customized tool bar. And the properties are applied to the tiny mce instance as a whole. But now, the requirement has come up that, the text editing should be in MS office style.That means, if user has placed cursor at one place and changes color, nothing will be affected, but if he starts typing from the cursor position the text should have the color which was set recently. I tried to use the external tool bar option. But, my work area and customized tool bar are at different z index levels. So, positioning the tool bar fails. If I append the tool bar to my customized tool bar, it is not click-able. So, how to invoke tiny mce's core functionality using customized tool bar?
Or, Kindly suggest, should I change editor ? Then, which one should I go for ?
EDIT
As per the suggestion, I'm writing the function save the property styles and insert the span at caret position. But I'm facing some problems and could not do it after spending whole day. I could add span at caret position by using following code.
marker = ed.selection.getBookmark();
ed.selection.moveToBookmark(marker);
tinyMCE.execCommand('mceInsertContent',false,'<span id="mytitle"></span>');
But still, I failed to type inside the new span. Also, I could not figure out how to set styles to this span.
If your aim is to have your tinymce behave like MS Office you should write an own plugin which will take care of this.
I suggest if a user has placed the cursor at one place and changes color you save this color as a setting to your tinymce instance like: ed.color = 'choosencolor';
When the user start typing now you can insert a span on the first keystroke and set the color as css class or style property to this span.

can we initialise different version of tiny mce for a single text box?

I want to create two instances of tiny mce which will have two different set of buttons. I'm trying to initialize both conditionally for a single text area. But, by default it takes the first inti set. am I right or wrong ? Help. Thanks
Problem will be that you can have only one tinymce instance globaly running. There might be a workaround for that, but i never saw one. The id of your textarea will be the id of your initialized editor. So you can have only one editor with one id - means only one tinymce instance with one editor for one textarea.

Is there a Zend_Form_Element that renders a plain div with some content?

Working on a bunch of forms at the moment and I'm finding that I want to be able to split a form into sections with some text in between. Is there a Zend_Form_Element that simply allows me to place some text mixed in with my form (not as a label or description linked to an individual input)?
Thanks!
I think there's not.
Although, you can do one of the following things:
If the text inbetween is more like a title, you can group them in display groups.
If you want to put a lot of text then you'll have to write your own custom form element.
If you choose the second option beware of your form decorations. If you want the text to be from side to side of the page (ie. without the labels space to the left and not aligned to the rest of the input forms) you'll probably have to disable default decorators and set new ones.