Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Version History

« Previous Version 2 Next »

Introduction

TinyMCE is an open source editor that is integrated into Contenido's backend to help authors entering and formatting text. This article is about how its integration is implemented.

Usage

The editor is used in several files. Here is the list of the files and what they are responsible for.

File namePurposeCalled tinymce/wrapper part
include_con_content_list.phpDisplays raw data of articleseditorclass.php
template.con_content_list.htmlTemplate included by include_con_content_list.php to render its pagecon_tiny.js, tiny_mce.js
include.con_editcontent.phpDisplays the editor page of articleeditorclass.php
template.con_editcontent.htmlTemplate included by include.con_editcontent.php to render its pagecon_tiny.js, tiny_mce.js
include.CMS_HTML.phpEditor page for content type CMS_HTMLeditor.php
include.CMS_HTMLHEAD.phpEditor page for content type CMS_HTMLHEADeditor.php

This means editing any CMS_HTML or CMS_HTMLHEAD type will bring up the WYSIWYG editor.

Contenido specific wrapper parts

class.wysiwyg_editor.php

Abstract class cWYSIWYGEditor for all WYSIWYG editors to be able to allow possible integration of other editors than tinyMCE in the future. This class is auto-loaded and thus always available.

editor.php

Called by Contenido's pre-defined content types that allow HTML markup. It first loads the editor class then sets the editor's width and height and injects a textarea tag into the output.

editorclass.php

Extends cWYSIWYGEditor. 

Interfaces/Dependencies

Often "editor.php" is called

Contendido wraps TinyMCE inside a JavaScript class named "Con.Tiny". This class hides a bit complexity from the 

Changes to TinyMCE

There are a few changes made to TinyMCE 3 to integrate it into Contenido's backend.

 

Settings

TinyMCE is quite configurable. Settings for TinyMCE are internally obtained by Contenido's getEffectiveSetting function. This means the editor is configured in the following order of priority (highest first): User, group, client (language), client and system.

 

  • No labels