定制 zeixcom/craft-delta 二次开发

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

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

zeixcom/craft-delta

最新稳定版本:1.0.0

Composer 安装命令:

composer require zeixcom/craft-delta

包简介

Inline revision diffing for Craft CMS — see exactly what changed

README 文档

README

Inline revision diffing for Craft CMS 5. Compare any two revisions, drafts, or the current version of an entry and see exactly what changed — word-level for text, block-level for Matrix, and value-level for everything else.

Requirements

  • Craft CMS 5.8+
  • PHP 8.2+

Installation

composer require zeixcom/craft-delta
php craft plugin/install craft-delta

Features

  • Word-level text diffing for Plain Text and CKEditor fields
  • Matrix diffing — added, removed, modified, and reordered blocks
  • Relational field diffing — Entries, Assets, Categories, Tags, Users
  • Table field diffing — row and cell-level changes
  • Option field diffing — Dropdowns, Radios, Checkboxes, Multi-select
  • Scalar diffing — Numbers, Dates, Lightswitches, Colors, Money, etc.
  • Draft comparison — compare drafts against revisions or the current version
  • Multisite support — diffs are site-aware
  • "Changed only" filter — toggle unchanged fields on/off
  • Diff summary stats — fields changed, additions/deletions
  • Translations — English, German, French, Spanish, Italian, Dutch, Portuguese, Polish

Usage

Open any entry with at least one revision. A "Compare Revisions" button appears in the sidebar. Click it to open the diff slideout.

Use the two dropdowns to select which versions to compare — Current, any draft, or any revision. The diff loads automatically when you change the selection.

  • Click the swap button to reverse the comparison direction
  • Toggle "Changed only" to hide unchanged fields

Settings

Configure under Settings > Plugins > Craft Delta:

Setting Default Description
Diff Context Lines 3 Unchanged lines shown around changes
Max Field Length 50,000 Characters before showing a simplified diff
Show Unchanged Fields Off Show unchanged fields by default

Extending

Register custom differs for third-party field types:

use zeixcom\craftdelta\services\FieldDiffService;
use zeixcom\craftdelta\events\RegisterDiffersEvent;

Event::on(
    FieldDiffService::class,
    FieldDiffService::EVENT_REGISTER_DIFFERS,
    function (RegisterDiffersEvent $event) {
        $event->differs[\myvendor\fields\MyField::class] = MyFieldDiffer::class;
    }
);

Custom differs must implement zeixcom\craftdelta\differ\DifferInterface.

Roadmap

Extend the plugin with the most popular third-party field types like NEO, Hyper, etc.

License

Proprietary — see LICENSE.md

统计信息

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

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: proprietary
  • 更新时间: 2026-03-04

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固