Daptal Ms
Daptal Ms

Reputation: 361

Remove some of the items from the Style drop down

I have added the advanced tool bar and in the toolbar groups added {name:'styles'}

When i add the styles by default it adds two buttons Styles and Format

How do i remove some of the items from Styles ?

For eg : Styles currently has block styles like 'Italic title', 'Subtitle', etc and Inline styles like 'Marker', 'Big', 'Typewriter' etc

I want to retain the styles but want to delete just couple of elements from the dropdown eg : 'Marker' , 'Subtitle'

Thanks

Upvotes: 1

Views: 506

Answers (1)

Vinod Kumar
Vinod Kumar

Reputation: 981

This link has a similar question.

Edit:

This code block is the extract of what you need to add before initialing CKEditor.

CKEDITOR.addStylesSet( 'mystyleslist',
[
    /* Inline Styles */

   { name : 'readMore', element : 'span', attributes : { 'class' : 'readMore' } },
   { name : 'BoldItal' , element : 'span', styles:
      {
      'font-weight' :   'bold',
      'font-style' :      'italic'
      }
   },

   /* Object Styles */

   {name : 'Image on Left', element : 'img',
      attributes :
      {
      'style' : 'padding: 5px; margin-right: 5px',
      'border' : '2',
      'align' : 'left'
      }
   },

   {name : 'Image on Right', element : 'img',
      attributes :
      {
      'style' : 'padding: 5px; margin-left: 5px',
      'border' : '2',
      'align' : 'right'
      }
   }
]);

CKEDITOR.config.stylesCombo_stylesSet = 'mystyleslist';

I hope this helps

Upvotes: 2

Related Questions