• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

My Monkey Do

A Log of Coding Solutions

  • Home
  • Web Hosts
  • Tools
  • About

tinymce

TinyMCE add Custom Characters

July 29, 2011 by Webhead

Problem:

The Hawaiian language has the kahako but tinymce does not have these in their charmap.

 

Solution:

To add more characters to the custom character map in tinymce, find the file:

themes/advanced/js/charmap.js

If you are using wordpress that directory is located in wp-includes/js/tinymce/

Open that file and you’ll see a list of characters in the charmap.  The first parameter is the html code, the second is the unicode character, the third is whether to display or not, the fourth is a description.   The easiest way to do this is to first know how many characters you are adding.  Then comment out that many lines which are displayed (have “true” as the third parameter).  Then add you characters.  Below are the characters I added for Hawaiian.

 

	['Ā',     'Ā',  true,'A kahako'],
	['Ē',     'Ē',  true,'E kahako'],
	['Ī',     'Ī',  true,'I kahako'],
	['Ō',     'Ō',  true,'O kahako'],
	['Ū',     'Ū',  true,'U kahako'],

	['ā',     'ā',  true,'a kahako'],
	['ē',     'ē',  true,'e kahako'],
	['ī',     'ī',  true,'i kahako'],
	['ō',     'ō',  true,'o kahako'],
	['ū',     'ū',  true,'u kahako'],

 

 

For a full explanation to add characters or if you don’t want to comment out existing characters, visit:  http://www.patrickgmj.net/node/66

Filed Under: Coding Tagged With: cms, tinymce, wordpress

Get TinyMCE to use Absolute Paths

May 25, 2011 by Webhead

Problem:

I was working with a customized CMS which uses the TinyMCE editor.  This editor was placed in a subfolder to edit content meant for the root folder.  This meant that the images in the TinyMCE editor would show something like “../images/” for the path to the images folder while the public pages would need something like “images/”.  The problem with TinyMCE was that every time you insert an image it would show the absolute path, but when it saved, it would be a relative path.

 

Solution:

To get TinyMCE to always use absolute paths, tell it to not use relative paths!  In tinyMCE.init where you configure the editor, add the options under the “use absolute urls” comment

 

tinyMCE.init({
    // General options
    mode : "textareas",
    theme : "advanced",
    width: "480",
    height: "400",

    //use absolute urls
    remove_script_host : false,
    relative_urls : false
});

 

Filed Under: Coding Tagged With: javascript, tinymce

Primary Sidebar

Topics

apache apple block editor chrome cms css debug eCommerce embed firebug firefox git gmail goDaddy google hosting htaccess html html 5 IE crap image iPad iPhone javascript jquery linux localization mac os x ms sql mysql open source optimize php php 5.3 responsive rest api seo svg tinymce woocommerce wordpress wpengine xss yii youtube




Categories

  • Coding
  • Off the Shelf
  • Plugins
  • Random Thoughts
  • Server Stuff
  • Tools