The phpcms Content Editor supports the setting of JavaScript and other scripting languages.

Source: Internet
Author: User

In the default Content Editor of phpcms V9 background, JavaScript scripts are disabled by default for security reasons.ArticleWhile adding JSCodeBut it does not actually work, but is displayed in text format. Therefore, you often need to modify this restriction so that JS Code can be displayed on the Content Page of the article.

Make the Content Page Support Javascript. The specific modification method is as follows:

Find the function in the file caches \ caches_model \ caches_data \ content_input.class.php:

Function get ($ data, $ isimport = 0 ){

$ This-> DATA = $ DATA = trim_script ($ data );

To:

Function get ($ data, $ isimport = 0 ){

$ This-> DATA = $ data; // do not call the filter function

This is mentioned in many places on the Internet. In fact, this setting alone is not enough, because it is only something in the cache that needs to be

Fundamentally changed:

Find the get function from phpcms/modules/content/fields/content_input.class.php and follow the preceding modification method,

This completely solves this problem.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.