Andy
Andy

Reputation: 169

cftextarea and custom toolbar on shared hosting

I have a cftextarea on a page on a shared hosting plan. On my local server, I edited fckconfig.js in the CFIDE directory for a custom toolbar tag and it works great.

   FCKConfig.ToolbarSets["AMStools"] = [
   ['Bold','Italic',  'Underline', 'TextColor' ,'FontSize', 'OrderedList','UnorderedList',       'RemoveFormat', 'Undo','Redo','-',]

] ;

The problem is the hosting company will not let me mess with CFIDE on their server which I fully endorse.

I tried putting the code on my page as:

<script type="text/javascript">
FCKConfig.ToolbarSets["AMStools"] = [
['Bold','Italic',  'Underline', 'TextColor' ,'FontSize', 'OrderedList','UnorderedList',     'RemoveFormat', 'Undo','Redo','-',]
 ] ;
 </script>

and the page ignores it. Though it does show in view source in my browser.

How can I get this function to work?

Upvotes: 0

Views: 248

Answers (1)

swapnil solanke
swapnil solanke

Reputation: 258

For customizing ckeditor toolbar you need to redefine CKeditor object by using plain javascript you can do the following to achieve this.

$(function(){
    $(".ckeditor").each(function(){
                        CKEDITOR.replace($(this).attr('id'), {  toolbar: [
                                        { name: 'styles', items: ['Format']},
                                        { name: 'basicstyles', items : [ 'Bold','Italic','Underline'] },
                                        [ 'Strike'],
                                        [ 'NumberedList', 'BulletedList'],
                                        [ 'Link'],
                                        ['RemoveFormat'],
                                        [ 'Source'],
                                        [ 'Maximize']
                                    ]}) 

                        }) 
    })

Upvotes: 3

Related Questions