se7enxweb/expfckeditorhtmlblock

Add Simple To Use HTML Block With HTML Editor Toolbar capabilities to Exponential

Maintainers

Package info

github.com/se7enxweb/expfckeditorhtmlblock

Language:JavaScript

Type:ezpublish-legacy-extension

pkg:composer/se7enxweb/expfckeditorhtmlblock

Statistics

Installs: 0

Dependents: 0

Suggesters: 0

Stars: 0

1.4.0 2026-05-19 13:48 UTC

This package is auto-updated.

Last update: 2026-05-19 13:52:41 UTC


README

An eZ Publish extension that replaces the standard HTML text area with a full FCKeditor 2.x WYSIWYG rich-text editor for the ezhtml datatype.

Originally based on SmileFCKeditor by Smile (2006). Maintained and updated for PHP 8 compatibility and modern browser support.

Features

  • Replaces plain <textarea> inputs with an embedded FCKeditor 2 instance
  • Configurable toolbar sets via fckeditor/fckconfig.js
  • Two optional eZ Publish content-browser plugins:
    • expeZlink — browse and insert links to eZ Publish content objects
    • expeZimage — browse and insert images from the eZ Publish media library
  • Template operator explinktomedia converts expobject://<node_id> URIs into resolved links at render time
  • Media browser with list, detailed, and thumbnail views
  • Full WYSIWYG editing including tables, lists, colours, special characters, page breaks, and smileys
  • Source view toggle for direct HTML editing

Requirements

  • eZ Publish 4.x / Exponential CMS
  • PHP 7.4 or 8.x
  • JavaScript enabled in the browser
  • Apache mod_rewrite or nginx equivalent

Installation

1. Place the extension

Copy or symlink the expfckeditorhtmlblock directory into your eZ Publish extension/ folder.

2. Add rewrite rules

Add the following lines to your .htaccess (or nginx equivalent) before the catch-all RewriteRule .* index.php line:

RewriteRule ^extension/expfckeditorhtmlblock/javascript/.* - [L]
RewriteRule ^extension/[^/]+/fckeditor/.* - [L]

3. Enable the extension

Either via the back-office (Setup → Extensions) or by adding to your settings/override/site.ini.append.php:

[ExtensionSettings]
ActiveExtensions[]=expfckeditorhtmlblock

4. Clear caches

Clear both eZ Publish caches and your browser cache after installation:

php bin/php/ezcache.php --clear-all

Configuration

Toolbar

Edit fckeditor/fckconfig.js and modify the FCKConfig.ToolbarSets["Default"] array to enable or reorder toolbar buttons.

Optional content-browser plugins

Uncomment the relevant lines in fckeditor/fckconfig.js:

FCKConfig.Plugins.Add('expeZlink');   // Insert links to eZ Publish content
FCKConfig.Plugins.Add('expeZimage');  // Insert images from eZ Publish media

Custom configuration file per template

In design/standard/templates/content/datatype/edit/ezhtml.tpl, the config path can be made conditional:

{if <my_condition>}
  oFCKeditor{$attribute.id}.Config["CustomConfigurationsPath"] = "{ezsys('wwwdir')}/extension/expfckeditorhtmlblock/fckeditor/fckconfig1.js";
{else}
  oFCKeditor{$attribute.id}.Config["CustomConfigurationsPath"] = "{ezsys('wwwdir')}/extension/expfckeditorhtmlblock/fckeditor/fckconfig2.js";
{/if}

Internal URL scheme

The explinktomedia template operator resolves internal object references of the form expobject://<node_id> into full URLs at render time. These are generated by the content browser and stored in the HTML content.

File structure

expfckeditorhtmlblock/
├── autoloads/
│   ├── eztemplateautoload.php      Template operator registration
│   ├── explinktomedia.php          explinktomedia operator (resolves expobject:// URIs)
│   └── stringoperators.php         Additional string template operators
├── datatypes/
│   └── ezhtml/
│       └── ezhtmltype.php          eZDataType subclass for the ezhtml field
├── design/
│   ├── admin/templates/
│   │   └── expfckeditorhtmlblock/
│   │       └── insertlink.tpl      Link insertion dialog template
│   └── standard/templates/
│       ├── content/datatype/
│       │   ├── edit/ezhtml.tpl     Edit-mode template (loads FCKeditor)
│       │   ├── view/ezhtml.tpl     View-mode template
│       │   └── pdf/ezhtml.tpl      PDF output template
│       ├── class/datatype/
│       │   ├── edit/ezhtml.tpl     Class attribute edit template
│       │   └── view/ezhtml.tpl     Class attribute view template
│       ├── mediabrowser_full_detailed.tpl
│       ├── mediabrowser_full_list.tpl
│       ├── mediabrowser_full_thumbnail.tpl
│       └── pagelayout_mediabrowser.tpl
├── fckeditor/                       FCKeditor 2 core (vendored)
│   ├── fckconfig.js                 Main FCKeditor configuration
│   ├── fckeditor.js                 FCKeditor loader
│   └── editor/                     Editor UI, dialogs, plugins, skins
├── javascript/
│   └── mediabrowser.js             Media browser JS
├── modules/
│   └── expfckeditorhtmlblock/      eZ Publish module (insertlink view)
│       ├── module.php
│       ├── function_definition.php
│       ├── functions.php
│       ├── insertlink.php
│       └── classes/
│           ├── expfckeditordb.php
│           └── expfckeditorfunctioncollection.php
├── settings/
│   ├── content.ini.append.php
│   ├── design.ini.append.php
│   ├── module.ini.append.php
│   └── site.ini.append.php
└── README.md

Upgrading from smilefckeditor

If upgrading from the original smilefckeditor extension:

  1. The extension directory must be renamed from smilefckeditor to expfckeditorhtmlblock (or symlinked).
  2. All stored content using smileobject:// URIs must be migrated to expobject:// — a database search-and-replace on the ezcontentobject_attribute data_text column is required.
  3. Update .htaccess rewrite rules (see Installation § 2).
  4. Update ActiveExtensions in your site INI settings.
  5. Clear all caches.

License

GNU Lesser General Public License v2 — see fckeditor/license.txt.