Jump to content

TIPS ใส่ Javascrip & style ใน CMS


phunsanit

Recommended Posts

ใช่ notepad หรืออะไรก็ พิมพ์
<?php
/* pitt add javascrip and style in cms */
class CMS extends CMSCore
{
    public static $definition = array(
        'table' => 'cms',
        'primary' => 'id_cms',
        'multilang' => true,
        'fields' => array(
            'id_cms_category' =>     array('type' => self::TYPE_INT, 'validate' => 'isUnsignedInt'),
            'position' =>             array('type' => self::TYPE_INT),
            'indexation' =>         array('type' => self::TYPE_BOOL),
            'active' =>             array('type' => self::TYPE_BOOL),

            // Lang fields
            'meta_description' =>     array('type' => self::TYPE_STRING, 'lang' => true, 'validate' => 'isGenericName', 'size' => 255),
            'meta_keywords' =>         array('type' => self::TYPE_STRING, 'lang' => true, 'validate' => 'isGenericName', 'size' => 255),
            'meta_title' =>            array('type' => self::TYPE_STRING, 'lang' => true, 'validate' => 'isGenericName', 'required' => true, 'size' => 128),
            'link_rewrite' =>         array('type' => self::TYPE_STRING, 'lang' => true, 'validate' => 'isLinkRewrite', 'required' => true, 'size' => 128),
            'content' =>             array('type' => self::TYPE_HTML, 'lang' => true, 'size' => 3999999999999),
        ),
    );
}

 

save เป็น override\classes\CMS.php
 

ทำให้ใส่ javascript และ style ใน cms ได้ ถ้าใช่ version อื่นที่ไม่ใช่ 1.6.0.7 ก็ไป copy function มาจากไฟล์ classes/CMS.php แล้วลบ , 'validate' => 'isCleanHtml' ออก

CMS.php

  • Like 2
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...