江湖CMS框架改成百度UEditor富文本編輯器

下載UEedit到/public/ueditor下。ueditor1_4_3_3-utf8-php版

添加文章模版/h1sg/web/system/admin/view/article/article/create.html

修改文章模版/h1sg/web/system/admin/view/article/article/edit.html

引用示例

<!DOCTYPE HTML>
<html lang="en-US">

<head>
    <meta charset="UTF-8">
    <title>ueditor demo</title>
</head>

<body>
    <!-- 加載編輯器的容器 -->
    <script id="container" name="content" type="text/plain">
        這裏寫你的初始化內容
    </script>
    <!-- 配置文件 -->
    <script type="text/javascript" src="ueditor.config.js"></script>
    <!-- 編輯器源碼文件 -->
    <script type="text/javascript" src="ueditor.all.js"></script>
    <!-- 實例化編輯器 -->
    <script type="text/javascript">
        var ue = UE.getEditor('container');
    </script>
</body>

</html>

 

支持iframe方法

說明:新版本ueditor要修改 xss過濾白名單 

修改配置文件ueditor.config.js 

搜索:  whitList 增加下面第二行即可

,whitList:{
iframe: ['frameborder','border','marginwidth','marginheight','width','height','src','id'],//增加這一行
a:      ['target', 'href', 'title', 'class', 'style'],
 

加入後iframe可以顯示

<p>
    &nbsp;my<iframe width="1111" height="111" src=" http://wjsou.com/ " frameborder="1"></iframe>
</p>

我發現江湖cms 保存時過濾掉了iframe,無法保存。也需要修改一下,使它能保存內容到數據庫。就可以了。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章