Home  >  Article  >  Web Front-end  >  Detailed explanation of the difference between html and htm in dedecms

Detailed explanation of the difference between html and htm in dedecms

高洛峰
高洛峰Original
2017-03-24 11:55:001722browse

The difference between htm and html in dedecms is whether it will be parsed when creating a document template

Note: If they are inconsistent, "template does not exist and cannot be parsed" will appear when dedecms background generates the document template. At this time We can modify the 564 lines of code in include/arc.archives.class.php. According to the actual situation, if your template is html and cannot be parsed, you need to change '#.htm$#' to '#.html$#'.

You can get the location of the template in line 564 of the dedecms source code arc.archives.class.php file

    /**
     *  获得模板文件位置
     *
     * @access    public
     * @return    string
     */
    function GetTempletFile()
    {
        global $cfg_basedir,$cfg_templets_dir,$cfg_df_style;
        $cid = $this->ChannelUnit->ChannelInfos['nid'];
        if(!empty($this->Fields['templet']))
        {
            $filetag = MfTemplet($this->Fields['templet']);
            if( !preg_match("#\/#", $filetag) ) $filetag = $GLOBALS['cfg_df_style'].'/'.$filetag;
        }
        else
        {
            $filetag = MfTemplet($this->TypeLink->TypeInfos["temparticle"]);
        }
        $tid = $this->Fields['typeid'];
        $filetag = str_replace('{cid}', $cid,$filetag);
        $filetag = str_replace('{tid}', $tid,$filetag);
        $tmpfile = $cfg_basedir.$cfg_templets_dir.'/'.$filetag;
        if($cid=='spec')
        {
            if( !empty($this->Fields['templet']) )
            {
                $tmpfile = $cfg_basedir.$cfg_templets_dir.'/'.$filetag;
            }
            else
            {
                $tmpfile = $cfg_basedir.$cfg_templets_dir."/{$cfg_df_style}/article_spec.htm";
            }
        }
        if ( defined('DEDEMOB') )
        {
            $tmpfile =str_replace('.htm','_m.htm',$tmpfile);
        }
        if(!file_exists($tmpfile))
        {
            $tmpfile = $cfg_basedir.$cfg_templets_dir."/{$cfg_df_style}/".($cid=='spec' ? 'article_spec.htm' : 'article_default.htm');
            if ( defined('DEDEMOB') )
            {
                $tmpfile =str_replace('.htm','_m.htm',$tmpfile);
            }
        }
        if (!preg_match("#.htm$#", $tmpfile)) return FALSE;
        return $tmpfile;
    }

Note: the place in red font

The above is the detailed content of Detailed explanation of the difference between html and htm in dedecms. For more information, please follow other related articles on the PHP Chinese website!

Statement:
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