Google Translate

If you are a Joomla user, for sure, you have already noted the button "Insert Predefined Template Content" .

Here you will find how to add the custom template content for TinyMCE.

I find very useful use of little snippets while typing an article in Joomla. Often the plugins require to write something like {pluginname parameter1=N, parameter2=Y ....}. Remember the syntax for all plugins it's not so easy.

Well, here we go...

 

WHAT WE NEED

  1. Editor
  2. FTP client
  3. html file with what we want to add  ;-)

 

STEPS

  1. Launch a client FTP , for example Filezilla
  2. open the folder:  media/editors/tinymce/templates (media is located under your server root and under your joomla installation. In my case the full path is /httpdocs/site/media/editors/tinymce/templates.
  3. Download and open the file template_list.js (let me suggest the use of an editor like Notepad++)
  4. You will find only the 2 default template: Layout and Simple snippet.
  5. Insert a new line and upload it

As you will note there are 3 column inside of each row:

  • Simple snippet is the short description for the combobox
  • media/editors/tinymce/templates/snippet1.html is the file with your content
  • Simple HTML snippet is the description for your content

 

My template_list.js

// This list may be created by a server logic page PHP/ASP/ASPX/JSP in some backend system.
// There templates will be displayed as a dropdown in all media dialog if the "template_external_list_url"
// option is defined in TinyMCE init.

var tinyMCETemplateList = [
	// Name, URL, Description

	["byman tag for plugin", "media/editors/tinymce/templates/byman_tag_for_plugin.html", "Tag for photoswipe"],
	["Code Highlighter GeSHi : HTML", "media/editors/tinymce/templates/Code_Highlighter_GeSHi_HTML.html", "HTMLLayout."],
	["Code Highlighter GeSHi : PHP", "media/editors/tinymce/templates/Code_Highlighter_GeSHi_PHP.html", "HTMLLayout."],
	["Code Highlighter GeSHi : Javascript", "media/editors/tinymce/templates/Code_Highlighter_GeSHi_JAVASCRIPT.html", "HTMLLayout."],
	["Layout", "media/editors/tinymce/templates/layout1.html", "HTMLLayout."],
	["Simple snippet", "media/editors/tinymce/templates/snippet1.html", "Simple HTML snippet."]

];

 

SCREENSHOTS

  • TinyMCE01
    TinyMCE01
  • TinyMCE02
    TinyMCE02
  • TinyMCE03
    TinyMCE03
  • TinyMCE04
    TinyMCE04
  • TinyMCE05
    TinyMCE05
  • TinyMCE06
    TinyMCE06
 

REFERENCES