cpoDesign
cpoDesign

Reputation: 9143

Customise CKEditor

i have installed ckeditor into my asp.mvc project, now i need to implement just some of the options that are implemented. How do i define the config file or what i have wrong in it?

<link href="../../ckeditor/contents.css" rel="stylesheet" type="text/css"></link>
<script src="../../ckeditor/ckeditor.js" type="text/javascript"></script>
<script src="../../../../ckeditor/config.js" type="text/javascript"></script>

<textarea class="ckeditor" cols="20" id="Article_Text" name="Article.Text" rows="2">

</textarea>

how ever this still render with default settings.

and my ckeditor config.js

CKEditor1.editorConfig = function( config )
{
    // Define changes to default configuration here. For example:
    config.language = 'cz';
    config.uiColor = '#FFF';
};
CKEditor1.config.toolbar = new object[]
{
    new object[] { "Source" },
    new object[] { "Bold", "Italic", "Underline", "Strike", "-", "Subscript", "Superscript" },
    new object[] { "NumberedList", "BulletedList", "-", "Outdent", "Indent" },
    "/",
    new object[] { "Styles", "Format", "Font", "FontSize", "TextColor", "BGColor", "-", "About" },
};

CKEditor_preview

Upvotes: 0

Views: 1867

Answers (2)

cpoDesign
cpoDesign

Reputation: 9143

i have found the basic solution

 <script src="../../Scripts/jquery-1.4.1.js" type="text/javascript"></script>  
  <script src="../../ckeditor/ckeditor.js" type="text/javascript"></script>
  <script src="../../ckeditor/adapters/jquery.js" type="text/javascript"></script>
  <script src="../../ckeditor/config.js" type="text/javascript"></script>

  <script type="text/javascript">
      $(function() {
      var config =
            {
              height: 180,
              width: 515,
              linkShowAdvancedTab: false,
              scayt_autoStartup: true,
              enterMode: Number(2),
              toolbar_Full: [['Styles', 'Bold', 'Italic', 'Underline', 'SpellChecker', 'Scayt', '-', 'NumberedList', 'BulletedList'],
                                ['Link', 'Unlink'], ['Undo', 'Redo', '-', 'SelectAll']]

            };
            $('#editor').ckeditor(config);
      });
    </script>
    <textarea name="myTextArea" id="editor">
        To learn more about ASP.NET MVC visit <a href="http://asp.net/mvc" title="ASP.NET MVC Website">http://asp.net/mvc</a>.
    </textarea>

Upvotes: 1

Zer001
Zer001

Reputation: 619

HI, it should be

CKEDITOR.editorConfig

instead of CKEditor1.editorConfig. I think it will work then.

here is the full documentation for ckeditor cofiguration.

Upvotes: 0

Related Questions