Home > CMS Tutorial > PHPCMS > What should I do if the phpcms editor does not display?

What should I do if the phpcms editor does not display?

藏色散人
Release: 2020-02-04 10:41:26
Original
2901 people have browsed it

What should I do if the phpcms editor does not display?

What should I do if the phpcms editor does not display? The phpcms website editor cannot be opened, and previously added articles cannot be edited?

1. First go to the official website to download the resource package (customize the editor navigation tool first, then customize and add the required functions before downloading)

Baidu Editor

2 , Upload to the default js file path of phpcms. The uploaded file path is as follows

\statics\js\ueditor\
Copy after login

3. Open /phpcms/libs/classes/form.class.php and find the following code:

if(!defined(‘EDITOR_INIT’)) { 
$str = ‘''; 
define(‘EDITOR_INIT’, 1); 
}
Copy after login

Replace with:

if(!defined(‘EDITOR_INIT’)) { 
$str = ‘''; 
$str .= ‘''; 
$str .= ‘''; 
define(‘EDITOR_INIT’, 1); 
} 
$str .= “'';
Copy after login

Code

Effect after modification

4. Open /statics/js/ueditor/editor_config.js and find the following code:

var URL; 
/** 
* 此处配置写法适用于UEditor小组成员开发使用,外部部署用户请按照上述说明方式配置即可,建议保留下面两行,以兼容可在具体每个页面配置window.UEDITOR_HOME_URL的功能。 
*/ 
var tmp = location.protocol.indexOf(“file”)==-1 ? location.pathname : location.href; 
URL = window.UEDITOR_HOME_URL||tmp.substr(0,tmp.lastIndexOf(“\/”)+1).replace(“_examples/”,””).replace(“website/”,””);//这里你可以配置成ueditor目录在您网站的相对路径或者绝对路径(指以http开头的绝对路径)
Copy after login

Replace with:

var URL; 
var tmp = window.location.pathname, 
URL= “/statics/js/ueditor/” 
/** 
* 此处配置写法适用于UEditor小组成员开发使用,外部部署用户请按照上述说明方式配置即可,建议保留下面两行,以兼容可在具体每个页面配置window.UEDITOR_HOME_URL的功能。 
*/ 
/ar tmp = location.protocol.indexOf(“file”)==-1 ? location.pathname : location.href; 
//URL = window.UEDITOR_HOME_URL||tmp.substr(0,tmp.lastIndexOf(“\/”)+1).replace(“_examples/”,””).replace(“website/”,””);//这里你可以配置成ueditor目录在您网站的相对路径或者绝对路径(指以http开头的绝对路径)
Copy after login

Just comment out the default "var tmp" and "URL" and replace them with the address of Baidu editor;

5. Modify the default width and height of the editor, Because the default editor of phpcms is not that big:

Find lines 112 and 113 in /statics/js/ueditor/editor_config.js,

//,initialFrameWidth:1000 //初始化编辑器宽度,默认1000 
//,initialFrameHeight:320 //初始化编辑器高度,默认320
Copy after login

is replaced with:

,initialFrameWidth:655 //初始化编辑器宽度,默认1000 
,initialFrameHeight:400 //初始化编辑器高度,默认320
Copy after login

So , the editor will not be deformed when adding an article.

PHP Chinese website, a large number of free PHPCMS tutorials, welcome to learn online!

The above is the detailed content of What should I do if the phpcms editor does not display?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template