定制 se7enxweb/expfckeditorhtmlblock 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

se7enxweb/expfckeditorhtmlblock

Composer 安装命令:

composer require se7enxweb/expfckeditorhtmlblock

包简介

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

README 文档

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.

统计信息

  • 总下载量: 0
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 2
  • 开发语言: JavaScript

其他信息

  • 授权协议: GPL-2.0-or-later
  • 更新时间: 2026-05-19

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固