Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Formating controls for headings (h1, h2, h3...) are not included in the base TinyMCE package. However there is a 3rd Party TinyMCE plugin that provides this.
- Download the plugin from SourceForge.
- Unzip the files and place header directory in your modules/tinymce/tinymce/jscripts/tiny_mce/plugins folder.
- The TinyMCE Drupal module handles plugins differently than stock TinyMCE, hence the standard plugin installation instructions do not apply. Instead edit the modules/tinymce/plugin_reg.php file and add the following lines immediately before
return $plugins;
$plugins['heading'] = array(); $plugins['heading']['theme_advanced_buttons1'] = array('h1,h2,h3,h4,h5,h6,separator'); $plugins['heading']['heading_clear_tag'] = array('p');
- on the TinyMCE settings page you should now see a button entry for the headings: "h1,h2,h3,h4,h5,h6,separator – heading". Enable the button.
That's it, you should now see buttons for headings in your editor.
Drupal 6
As of Jan 2009, All you need to do is enable "HTML block format" if using the latest dev for 6.x
Comments
HTML Block Format
Using HTML Block Format is definitely the best way to do this.
If anyone still uses the plugin for older versions, I found putting this code in a custom module worked well, once the plugin was downloaded:
(found this here http://openconcept.ca/blog/stevem/howto_add_headings_tinymce_plugin_to_w...)
Drupal 7
I followed these instructions by jsims281 which have worked for me with Drupal 6, but no dice in drupal 7.
Does anyone know if there is an additional step necessary?
The options show up on the WYSIWYG configuration page, but they don't show up on the content authoring pages even after being checked and saved.
I can get the buttons to
I can get the buttons to appear in Drupal 7, but when clicking on them I just get an error in the console that makes me think it's a no go.
Pretty important
Seems like a pretty important thing to have for Drupal 7 and beyond! I have a client who wants it too.
Nora McDougall-Collins
http://facebook.com/MontanaWebmasterTeam
Use the " HTML block format"
Use the " HTML block format" button that comes with TinyMCE. It adds Headers (H1 H2 H3 etc).
Use "Block Format"
That works in my Drupal 7 installation. The plugin is called "Block Format"