despark/html-template-curator
Composer 安装命令:
composer require despark/html-template-curator
包简介
Laravel 5.1 package, which enables you to manage complicated HTML templates, preserving the design integrity.
README 文档
README
Laravel 5 package, which enables you to manage complicated HTML templates, preserving the design integrity. (if you want to use this plugin with Laravel 4 please require the v1.0.2 )
The purpose of this package is to help you implement rich text editing for complicated HTML views, but remove the risk of breaking the beautiful designs, which your talanted designers produced.
The idea is that when coding your HTML templates you add the eg-editable class to all the elements, which you want to enable for editing through the HTML Template Curator and the curator automatically injects inline editors for them only when initialised.
Genting Started
-
Add the following dependency to your composer.json's require section:
"despark/html-template-curator": "2.*"In order to use the plugin you need to set composer's
minimum-stabilityto beta, because we are using cviebrock/image-validator in beta release, since stable is still not provided for Laravel 5. -
Run composer update
-
Add the HTML template curator's service provider in * config/app.php*
'Despark\HtmlTemplateCurator\HtmlTemplateCuratorServiceProvider::class', -
Run
php artisan vendor:publish --provider="Despark\HtmlTemplateCurator\HtmlTemplateCuratorServiceProvider" --tag="views"to publish views -
Run
php artisan vendor:publish --provider="Despark\HtmlTemplateCurator\HtmlTemplateCuratorServiceProvider" --tag="config"to publish the configuration files -
Run
php artisan vendor:publish --provider="Despark\HtmlTemplateCurator\HtmlTemplateCuratorServiceProvider" --tag="public"to publish the assets -
Put your amazing HTML templates (which include the required
eg-editableon all the editable sections) in a new folder called templates in your public directory. (In the /public/packages/despark/html-template-curator/templates/ folder you will find some examples of HTML templates) -
In the views where you want to enable the Template Curator functionality you need to have atleast the following two elements.
A
<select>field which will load the available templates, so that the user can select the layout, which to edit. E.g.{{ Form::select('template', [], null, ['class' => 'form-control js-artice-template']) }}A
<textarea>element in which the raw and up to date HTML of the template will be loaded. (keep in mind that this element will be automatically hidden by the script) E.g.{{ Form::textarea('content', null, ['id' => 'content']) }} -
In the view which will hold the editor after the definition of the elements above add the following code:
@include('packages.despark.html-template-curator.partials.modal_editor_definition') {{-- Includes the modal popup --}} @include('packages.despark.html-template-curator.partials.script') {{-- The needed JavaScript files for the HTML Template Curator --}} <script> $(function () { $('.js-artice-template').templateEditor('#content'); /* In addition you can define the currently selected template with its value in select box as second parameter - usefull when editing already saved page. And custom selector for the container, which will contain the visual presentation of the template as a 3rd parameter E.g. $('.js-artice-template').templateEditor('#content', 'book', '#my_selector');*/ }); </script>
You can uncoment {{-- <script src="{{ asset('vendor/html-template-curator/js/vendor/jquery/dist/jquery.min.js') }}"></script> --}} if you don't already have jQuery required somewhre in your code.
10. Add the available templates in the following config: * config/html-template-curator.php* under the templates key of the config array. As key for each element of the array put the name of the folder in which the template is stored and as a value put the display name you want to appear in the select field.
11. Make sure you have set the proper app URL in the * config/app.php* file
12. After you are done navigate the page you just created and start editing your templates.
In the package views you will find a folder called examples, which contains sample implementations of the editor.
P.S.: Keep in mind that this is still work in progress, so there might some small issues for resolving, but I count on you and your great pull-requests to make it a great plugin
despark/html-template-curator 适用场景与选型建议
despark/html-template-curator 是一款 基于 JavaScript 开发的 Composer 扩展包,目前已累计 135 次下载、GitHub Stars 达 1, 最近一次更新时间为 2015 年 08 月 07 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「text」 「wysiwyg」 「editor」 「laravel」 「rich」 「despark」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 despark/html-template-curator 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 despark/html-template-curator 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 despark/html-template-curator 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Texy converts plain text in easy to read Texy syntax into structurally valid (X)HTML. It supports adding of images, links, nested lists, tables and has full support for CSS. Texy supports hyphenation of long words (which reflects language rules), clickable emails and URL (emails are obfuscated again
Adds more BBCode
Common libraries used by Zimbra Api
WYSIWYG editor for Yii2 based on Bootstrap 3
UEditor 是一套开源的在线HTML编辑器,主要用于让用户在网站上获得所见即所得编辑效果,开发人员可以用 UEditor 把传统的多行文本输入框(textarea)替换为可视化的富文本输入框。
Text file manipulation
统计信息
- 总下载量: 135
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 27
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2015-08-07