Contentdokter

houdt uw content gezond...

Skip navigation.

CMS Blog

Teamsite's TinyMCE considered very useful, with this hack 1 Antwort

I've blogged before on how disappointed I was with Interwoven's implementation of TinyMCE. I now found a way to circumvent the problems with it. This trick (or rather a full-blown hack) will enable you to use all of the configuration-options offered by TinyMCE.

But, WARNING, WARNING, this hack comes with a clear price:
- it comes with no support, not from Interwoven, neither from me.
- future patches can/will be overwrite your changes in dc-editor.js

The hack involves making changes to two files:

Changes to dc-editor.js:
1. Open [iw-home] httpd/webapps/content_center/datacapture/dc_editor.js in an editor
2. Locate the function 'IWTinyMCEEditor.prototype.initialize'
3. Add this code to the bottom of this function:


//custom: custom addition 1
custom_tinymce_additional_configuration(tinymce, editorConfig);
//custom: end of custom addition 1


4. add this code right BELOW this function:


//custom addition 2 (1 line only):
var custom_tinymce_included = true; //to signal that the custom code is include in this file


Changes to custom_config.js:
1. Open [iw-home] httpd/iw/tinymce/config/custom_config.js
2. Add this code to the file (location does not matter, bottom is most appropriate):


//custom: custom code begin
//test to see if our custom code is included in the dc-editor.js file:
if (typeof custom_tinymce_included == 'undefined') {
alert('ERROR: custom-tinymce code is missing from dc_editor.js!!! Please contact your admin.');
}

//the function that does all the hard work and that should be called from dc-editor.js
function custom_tinymce_additional_configuration(tinymce, editorConfig) {

//a hash that sets all the default configuration-values
var defaultConfig = {
/*the key/values as set by interwoven:*/
debug: false, //not sure of the effect of this, use with care!
//mode: "exact", //DO NOT SET THIS
//textarea_trigger: "tinymce", //DO NOT SET THIS
//language: "en", //language pack is managed by the java-code via property; can not be set via custom-config
theme: "advanced",
//init_instance_callback: "parent.getDCFrame().IWTinyMCEEditor.instanceInit", //DO NOT SET THESE
//handle_event_callback: "parent.getDCFrame().IWTinyMCEEditor.handleEvent", //DO NOT SET THESE
plugins : "table,iwlink,iwimg,searchreplace,iespell,paste,contextmenu,zoom,insertdatetime,emotions",

theme_advanced_toolbar_location: "top",
theme_advanced_toolbar_align: "left",
theme_advanced_path_location: "bottom",
/*
theme_advanced_b***ons1 : "whitespace,styleselect,formatselect,fontselect,fontsizeselect,forecolor,|,bold,italic,underline",
theme_advanced_b***ons2 : "bullist,numlist,|,outdent,indent,|,justifyleft,justifycenter,justifyright,justifyfull,|,cut,copy,paste,pasteword,search,|,undo,redo,|,iespell,anchor,link,unlink",
theme_advanced_b***ons3 : "hr,removeformat,visualaid,|,sub,sup,|,charmap,|,image,table,help,code",
theme_advanced_styles : "Header 1=header1;Header 2=header2;Header 3=header3",
table_styles : "Header 1=header1;Header 2=header2;Header 3=header3",
table_cell_styles : "Header 1=header1;Header 2=header2;Header 3=header3;Table Cell=tableCel1",
table_row_styles : "Header 1=header1;Header 2=header2;Header 3=header3;Table Row=tableRow1",
*/
//theme_advanced_b***ons1 : b***onRow1, //DO NOT SET THESE
//theme_advanced_b***ons2 : b***onRow2, //DO NOT SET THESE
//theme_advanced_b***ons3 : b***onRow3, //DO NOT SET THESE
//theme_advanced_styles : themeStyles, //DO NOT SET THESE
//table_styles : tableStyles, //DO NOT SET THESE
//table_cell_styles : tableCellStyles, //DO NOT SET THESE
//table_row_styles : tableRowStyles, //DO NOT SET THESE
content_css : "/iw/tinymce/config/custom_content.css",
paste_create_paragraphs : false,
paste_use_dialog : true,

/*the key/values from the 'general' options (see: /iw/tinymce/docs/reference_configuration.html)*/
//ask: //not very useful for templating
//elements: "", //DO NOT SET THIS
doc_language: "en",
directionality : "ltr",
//auto_reset_designmode : true, //not useful for templating
//auto_focus : "mce_editor_2", //not useful for teamplating??
//nowrap: false, //no wrap seems a little buggy....
b***on_tile_map: false, //untested
//auto_resize : true //experimental
//browsers : "msie,gecko" //not useful for templating
//dialog_type : "modal" //not useful for templating

/*the key/values from the 'cleanup/output' options (see: /iw/tinymce/docs/reference_configuration.html)*/
cleanup: true, //untested
//valid_elements : "" //better not to touch, use extended_valid_elements instead
extended_valid_elements: "",
invalid_elements: "",
trim_span_elements:true,
//verify_css_classes : true //not useful for templating
verify_html : true,
preformatted : false,
//encoding : "xml" //not useful/dangerous for templating
auto_cleanup_word : false,
cleanup_on_startup : false,
fix_content_duplication : true,
//inline_styles : true //experimental
convert_newlines_to_brs : false,
force_br_newlines : false,
force_p_newlines : true,
//entities : "" //better leave untouched
entity_encoding : "named",
//remove_linebreaks : false //not useful for templating

/* all other options are skipped here */

/* a dummy to end the hash without a , */
xxxx: 'yyyy'
};
//defaultConfig = {};

//loop over the hash set above
for (var prop in defaultConfig) {
//newvalue: if set in param then use this else use value from hash above
var newValue = editorConfig.getConfigItem(prop) != "" ? editorConfig.getConfigItem(prop) : defaultConfig[prop];

//set the value
tinymce.settings[prop] = newValue;
}
}
//custom: custom code end


Now you can make your custom configuration of TinyMce in the Teamsite way. Fi:

IWTinyMCECustomConfig("config-id", "directionality", "rtl");


Note that this code will give an alert to the end-user if your dc-editor.js is overwritten. Further, in IE6 (oh, not yet IE again!), if you have more then 1 textarea with different configuration-names, not all options work a required.

The above has been tested on Teamsite 6.7.1 (at solaris). Later Service Packs and versions have modified TinyMce implementations.

Good luck with it.

Posted am 26.05.2009 Kategorie:Teamsite Kommentar hinzufügen | Kommentare ansehen [1]

Teamsite's TinyMCE considered harmful

Since the 6.7.1 Service pack 1 Teamsite is blessed with a second rich text editor for use in content entry screens. At first glance this editor, named TinyMCE, offers a big gain over the previous option for this, the Visual Formatter Active-X component, since TinyMCE is a html&javascript only implementation. And this removes the need for a client installation (not very feasible today when most workstations are locked down from admin-privileges) and better performance. Furthermore, TinyMCE is a well known, open source/standards and highly customizable editor. Sounds really good, doesn't it?

Well, actually no. Interwoven has chosen to wrap the original TinyMCE object into a custom implementation that really hides all but the basic configuration options. So yes, you can (re)organize the standard toolbar-b***ons and you can define a list of text- and table-styles. Well and that's all.

Some examples of what I really miss for configuration (and that is offered in the standard TinyMCE) is:
- turn html cleaning on/off
- configure which elements/attributes are cleaned
- extra cleaning when pasting from ms-word
- which style-sheet is used in the editor (note: because of this you are forced to share 1 stylesheet across all branches that share the same server, very disappointing)

Apart from the above remarks the TinyMCE version that comes with Teamsite is old (1.4.5) while 3.2.2 is current today.
Let's hope that Interwoven will soon upgrade to a more recent version AND open all of the standard available options to us.

BTW, below is a little but nasty workaround that will NOT be overwritten when you upgrade you Teamsite install:
1. move your <iw-home>httpd/iw/tinymce to <iw-home>httpd/iw/tinymce2
2. locate the 'alias'-section in <iw-home>/iw-webd/conf/iwwebd.conf.template and add these lines BEFORE the alias for /iw/:
Alias /iw/tinymce/ "__IW_TS_HOME__/httpd/iw/tinymce2/"
Alias /iw/tinymce "__IW_TS_HOME__/httpd/iw/tinymce2"

3. run 'iwreset -ui'
4. now you are free to modify the <iw-home>/httpd/iw/tinymce2/config/custom_config.js to change the default settings

Posted am 21.03.2009 Kommentar hinzufügen

What is new in Teamsite 6.7.2?

If you want to know more about the new Teamsite 6.7.2 version I would recommend the devnet-webcast at: Devnet webcasts (free membership) but in short here is a quick (but disappointing) list:

1. Vista support (what now already?)

2. Teamsite and Livesite are now included in 1 install (which makes it a 1.3GB (!!) download).

3. Templating forms: one can now 'search and replace' in a dcr-form.

4. Livesite now offers 'fixed layouts', meaning that a developer can now better control in what layout area a component can be placed by teh end-user. In my opinion, this is a major 'must have' but I'm unsure if the current implementation really covers all (complex) business-requirements that one can think of in this area.

5. Livesite has better/more support for content targeting based on all sorts of profiles.

This Teamsite release shows the strategic move from Interwoven from a cms vendor to marketing tools vendor. Something that pleases Gartner analysts and that might not be a bad idea if one would have a mature finished cms tool set. :-) That's why I'm quite disappointed with this release.

Posted am 06.11.2008 Kategorie:Teamsite Kommentar hinzufügen
Your language: Nederlands In english Auf deutsch En français