ecshop 定義模板路徑

文件位置ECSHOP根目錄\includes\init.php

在 $smarty->assign('ecs_charset', EC_CHARSET);
下面增加  $smarty->assign('template_dir', 'themes/' . $_CFG['template']);
在模板中就直接調用
可以參考下面的css調用的方法:

 if (!empty($_CFG['stylename']))

    {

        $smarty->assign('ecs_css_path', 'themes/' . $_CFG['template'] . '/style_' . $_CFG['stylename'] . '.css');

    }

    else

    {

        $smarty->assign('ecs_css_path', 'themes/' . $_CFG['template'] . '/style.css');

    }

{$ecs_css_path}

{$template_dir}

就OK了.

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