Custom Editor

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

Please do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.

This forum is for discussing mojoPortal development

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

You can monitor commits to the repository from this page. We also recommend developers to subscribe to email notifications in the developer forum as occasionally important things are announced.

Before posting questions here you might want to review the developer documentation.

Do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.
This thread is closed to new posts. You must sign in to post in the forums.
11/30/2009 4:24:42 PM
Gravatar
Total Posts 12

Custom Editor

Hi

I am trying to build a custom editor (example: http://kuralweb.com/Tamil.aspx) that enable user to switch between English and unicode characters. At the moment I cant figure out a way to use one editor for admin edit and another for comments on blog module. Eventually I am hoping to achieve Tiny MCE Editor for Blog admin edit and my custom editor for end user comments without creating any 'MojoForks'. Has anyone done this before with MojoPortal? Any help will be much appreciated.

 

Masil

12/3/2009 8:38:06 AM
Gravatar
Total Posts 18439

Re: Custom Editor

We use the same editor for all features but the features included in the editors vary by what toolbars we enable. You customize by overriding our configurations.

http://www.mojoportal.com/customizing-the-editor-toolbars.aspx

All the editors support unicode or ascii chars, basically whatever you type.

Hope it helps,

Joe

6/21/2011 7:08:08 AM
Gravatar
Total Posts 20

Re: Custom Editor

Hi Joe,

I am referring to the link :

http://www.mojoportal.com/customizing-the-editor-toolbars.aspx

I acted like suggested, but the FCKeditor did not get the changes.

I know that it is not recommended in several pages, but I would like to add in the toolbox the buttons regarding :

.Font Color

.Background color

.Font type and font size.

I made also modification in Web.config, but the system did not get the modification.

Any additional help? Because in the information provided in the link it is not explained where to touch in the mojofckconfig.js. I tried to see original documentation in the web site of FCKeditor, but I did non understand what to change in the configuration to make such additional tools appear.

Joe,

thank you in advance for any help you may provide about.

Tks

Alex

crying

 

 

 

 

6/21/2011 8:23:58 AM
Gravatar
Total Posts 18439

Re: Custom Editor

Hi,

1. Don't edit mojofckconfig.js, copy it and rename it like mycustomfckconfig.js

2. Add this to user.config

<add key="FCKeditor:CustomConfigPath" value="~/ClientScript/mycustomfckconfig.js"/>

so it points to your custom file.

3. look at the toolbar definitions in your custom file, mojoPortal uses only the ToolbarSets "Full", "Newsletter", "FullWithTemplates", "BlogComment", "Forum"

You will also see a toolbar named "Default" which is not used by mojoPortal but from there you can copy the needed things like 'FontFormat','FontSize','TextColor','BGColor' and add them to the "Full" and "FullWithTemplates" toolbars.

You may need to touch Web.config to make it load the setting from user.config and you may need to clear your browser cache so it sees your new custom config js file.

But one day when the day comes to redesign your site I predict you will regret having all this un-skinnable hard coded fonts, colors, and style in your content. It will create a lot of work for you later when you want to change it.

Also FCKeditor would be my last choice of editor because it is not actively developed and will not be updated for modern things like HTML 5. I recommend CKeditor or TinyMCE.

Hope that helps,

Joe

6/21/2011 10:29:23 AM
Gravatar
Total Posts 20

Re: Custom Editor

Hi Joe,

Thank you Joe for your help and for your quick reply.

I shifted to CKEDITOR after what you told me.

I will be going to understand the CKEDITOR.editorConfig file.Inside the file js,

It sounds like a declaration of several  configuration profiles,but it seems there is no choice among these lines. Probably the choice is in web.config.

----------------

CKEDITOR.editorConfig = function( config )
{
// Define changes to default configuration here. For example:
// config.autoLanguage = false;
    // config.defaultLanguage = 'pt-br';
    // config.contentsLangDirection = 'rtl'
    //config.theme = 'default';
config.entities = false;
//config.smiley_path = '/Data/SiteImages/emoticons/';
config.scayt_autoStartup = true;
   
config.toolbar_CKFull =
[
  ['Source','-','Save','NewPage','Preview','-','Templates'],
  ['Cut','Copy','Paste','PasteText','PasteFromWord','-','Print', 'SpellChecker', 'Scayt'],
  ['Undo','Redo','-','Find','Replace','-','SelectAll','RemoveFormat'],
  ['Form', 'Checkbox', 'Radio', 'TextField', 'Textarea', 'Select', 'Button', 'ImageButton', 'HiddenField'],
  '/',
  ['Bold','Italic','Underline','Strike','-','Subscript','Superscript'],
  ['NumberedList','BulletedList','-','Outdent','Indent','Blockquote'],
  ['JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock'],
  ['Link','Unlink','Anchor'],
  ['Image','Flash','Table','HorizontalRule','Smiley','SpecialChar','PageBreak'],
  '/',
  ['Styles','Format','Font','FontSize'],
  ['TextColor','BGColor'],
  ['Maximize', 'ShowBlocks','-','About']
];


config.toolbar_Full =
    [
  ['Source'],
  ['SelectAll', 'RemoveFormat', 'Cut', 'Copy', 'Paste', 'PasteText', 'PasteWord', '-', 'Print', 'SpellChecker', 'Scayt'],
  ['Undo','Redo','-','Find','Replace'],
  '/',
  ['Blockquote','Bold','Italic','Underline','Strike','-','Subscript','Superscript'],
  ['NumberedList','BulletedList','-','Outdent','Indent'],
  ['JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock'],
  ['Link','Unlink','Anchor'],
  ['Image','Flash','Table','HorizontalRule','Smiley','SpecialChar'],
  '/',
  ['Styles'],
  ['Maximize']

    ];

config.toolbar_Newsletter =
    [
  ['Source'],
  ['SelectAll', 'RemoveFormat', 'Cut', 'Copy', 'Paste', 'PasteText', 'PasteWord', '-', 'Print', 'SpellChecker', 'Scayt'],
  ['Undo', 'Redo', '-', 'Find', 'Replace'],
  '/',
  ['Blockquote', 'Bold', 'Italic', 'Underline', 'Strike', '-', 'Subscript', 'Superscript'],
  ['NumberedList', 'BulletedList', '-', 'Outdent', 'Indent'],
  ['JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock'],
  ['Link', 'Unlink', 'Anchor'],
  ['Image', 'Table', 'HorizontalRule', 'SpecialChar'],
  '/',
  ['Format', 'Font', 'FontSize'],
  ['TextColor', 'BGColor'],
  ['Maximize','Preview']

    ];

config.toolbar_FullWithTemplates =
    [
  ['Source'],
  ['SelectAll', 'RemoveFormat', 'Cut', 'Copy', 'Paste', 'PasteText', 'PasteWord', '-', 'Print', 'SpellChecker', 'Scayt'],
  ['Undo','Redo','-','Find','Replace'],
  '/',
  ['Blockquote','Bold','Italic','Underline','Strike','-','Subscript','Superscript'],
  ['NumberedList','BulletedList','-','Outdent','Indent'],
  ['JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock'],
  ['Link','Unlink','Anchor'],
  ['Image','Flash','Table','HorizontalRule','Smiley','SpecialChar'],
  '/',
  ['Templates','Styles'],
  ['Maximize']

    ];

config.toolbar_Forum =
    [
  ['Cut','Copy','PasteText','-'],
  ['Undo', 'Redo', '-', 'Find', 'Replace', 'SpellChecker', 'Scayt', '-', 'SelectAll', 'RemoveFormat'],
  ['Blockquote','Bold','Italic','Underline'],
  ['NumberedList', 'BulletedList'],
  ['Link','Unlink'],
  ['SpecialChar','Smiley']
];

config.toolbar_ForumWithImages =
    [
  ['Cut','Copy','PasteText','-'],
  ['Undo','Redo','-','Find','Replace','SpellChecker', 'Scayt','-','SelectAll','RemoveFormat'],
  ['Blockquote','Bold','Italic','Underline','Image'],
  ['NumberedList', 'BulletedList'],
  ['Link','Unlink'],
  ['SpecialChar','Smiley']
];

config.toolbar_SimpleWithSource =
    [
  ['Source','Cut','Copy','PasteText'],
  ['Blockquote', 'Bold', 'Italic', '-', 'NumberedList', 'BulletedList', '-', 'Link', 'Unlink', 'SpellChecker', 'Scayt', 'Smiley']
];

config.toolbar_AnonymousUser =
    [
  ['Cut','Copy','PasteText'],
  ['Blockquote', 'Bold', 'Italic', '-', 'NumberedList', 'BulletedList', '-', 'Link', 'Unlink', 'Smiley']
];

};

---------------------------

 

 

Alex

 

6/21/2011 11:31:14 AM
Gravatar
Total Posts 18439

Re: Custom Editor

mojoPortal uses the toolbar names I already told you about.

The solution for CKeditor is very similar only the toolbar syntax is slightly different than with FCKeditor.

If you copy the toolbar items for fonts and colors from the _CKFull toolbar which is not used to the _FullWithTemplates toolbar it should work.

You must sign in to post in the forums. This thread is closed to new posts.