fulgurio / light-cms-tinymce-bundle

LightCMS 套件的 Tinymce 模块

安装次数: 14

依赖者: 0

建议者: 0

安全: 0

星标: 0

关注者: 2

分支: 0

开放问题: 0

语言:JavaScript

类型:symfony-bundle

dev-master 2018-02-19 08:41 UTC

This package is not auto-updated.

Last update: 2024-09-28 18:47:39 UTC


README

LightCMS 的 TinyMCE 编辑器插件。如果你喜欢 TinyMCE 作为所见即所得的编辑器,这个插件对 LightCMS 将非常有用。

安装

首先,如果你还没有安装 LightCMS,需要先安装它。请查看 LightCMS 插件项目在 github 上的介绍

之后,你需要安装 LightCMSTinyMCEBundle。这很容易

  1. 下载 FulgurioLightCMSBundle 及其依赖包
  2. 配置自动加载器
  3. 启用插件
  4. 配置 yml 文件以使用 TinyMCE 作为编辑器
  5. 同样配置 TinyMCE

步骤 1: 下载 FulgurioLightCMSBundle 及其依赖包

在你的 deps 文件中添加以下行(可以在同时安装 DoctrineFixturesBundle 时进行)

[LightCMSTinyMCEBundle]
    git=http://github.com/fulgurio/LightCMSTinyMCEBundle.git
    target=/bundles/Fulgurio/LightCMSTinyMCEBundle

只需使用供应商加载工具下载该插件

$ php bin/vendors install

步骤 2: 配置自动加载器

Fulgurio\\LightCMSTinyMCEBundle 命名空间添加到你的自动加载器

<?php
// app/autoload.php

$loader->registerNamespaces(array(
    // ...
    'Fulgurio\\LightCMSTinyMCEBundle' => __DIR__.'/../vendor/bundles',
));

步骤 3: 启用插件

最后,在内核中启用该插件

<?php
// app/AppKernel.php

public function registerBundles()
{
    $bundles = array(
        // ...
        new Fulgurio\LightCMSTinyMCEBundle\FulgurioLightCMSTinyMCEBundle(),
    );
}

步骤 4: 配置你的 yml 文件

你需要配置 LightCMSBundle。在你的 config.yml 文件中添加或完善以下行

fulgurio_light_cms:
    wysiwyg: fulgurio_light_cms_tiny_mce

这样就完成了!清除缓存,查看 LightCMS 的管理页面。现在你已经安装了 TinyMCE!

步骤 5: 同样配置 TinyMCE

好的,TinyMCE 已安装,你可能想限制选项。只需添加和更改以下行

fulgurio_light_cms_tiny_mce:
    config:
        content_css:      bundles/mybundle/css/styles-tinymce.css
        plugins:          autolink,lists,spellchecker,style,layer,table,advhr,advimage,advlink,emotions,iespell,inlinepopups,media,contextmenu,paste,directionality,noneditable,visualchars,nonbreaking,xhtmlxtras,template
        theme_advanced_buttons1: bold,italic,underline,|,bullist,numlist,|,link,unlink,|,image,code,|,formatselect
        theme_advanced_buttons2: 
        theme_advanced_buttons3: 

如果你了解 TinyMCE,你知道你可以更改加载的插件和工具的显示。正如你所看到的,你可以在

        plugins:          autolink,lists,spellchecker,style,layer,table,advhr,advimage,advlink,emotions,iespell,inlinepopups,media,contextmenu,paste,directionality,noneditable,visualchars,nonbreaking,xhtmlxtras,template

行中添加或删除插件,在

        theme_advanced_buttons1: bold,italic,underline,|,bullist,numlist,|,link,unlink,|,image,code,|,formatselect
        theme_advanced_buttons2: 
        theme_advanced_buttons3: 

行中添加或删除工具

很简单!

        content_css:      bundles/mybundle/css/styles-tinymce.css

最后的配置:通常,你会忘记将前端的样式应用到管理界面。这里,你可以使用相同的样式文件添加到编辑器,使用以下行

其中 bundles/mybundle/css/styles-tinymce.css 是 TinyMCE 加载的 CSS 文件