I have a simple form:

$form['module']['name'] = array(
        '#type' => 'text_format',
        '#title' => t('Name'),
        '#description' => $this->t('Some notes'),
        '#required' => FALSE,
        '#default_value' => '',
        '#format' => 'full_html',
        '#allowed_formats' => array('full_html'),

and it gives me: How to remove certain toolbar?

Which is good, but then, i want to manage the toolbar to remove certain buttons (e.g. only allow bold, italic, and strikethrough and remove remaining)

Can this be achieved from my custom module?


You need to +Add new text format over at /admin/config/content/formats

enter image description here

Then Configure your new text format and remove those icons by grabing them and dragging them from the active toolbar to the available buttons section

enter image description here

Lastly, instead of full_html, use your custom format for your custom module.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.