joomla T3框架中模板分离与自定义(local文件夹 实战研究)

 

1.重写布局配置(kjxxzx-corporate-home.ini)

模板商purity_iii提供的布局配置文件的路径:/templates/purity_iii/etc/layouts

自定义布局时,用户布局配置文件应放在:/templates/purity_iii/local/etc/layouts

2. 重写布局文件(kjxxzx-corporate-home.php)

模板商提供的布局文件的路径:/templates/purity_iii/tpls

如果用户想重写布局文件或区块文件,只需要将默认的布局文件复制并粘贴到/templates/purity_iii/local/tpls下

2.1例子:

2.1.1自定义“corporate”布局文件

复制:/templates/purity_iii/tpls/corporate.php

粘贴到:/templates/purity_iii/local/tpls/kjxxzx-corporate-home.php

2.1.2自定义“footer”区块文件

复制:/tempaltes/purity_iii/tpls/blocks/footer.php

粘贴到:/templates/purity_iii/local/tpls/blocks/kjxxzxfooter.php

3 .重写Joomla核心模块样式

Joomla核心布局文件存放于/templates/purity_iii/local/html/中。

例如你想改写Joomla菜单模块样式,方法如下:

复制:{root}/components/modules/mod_menu/tmpl/default.php

粘贴:{root}/templates/purity_iii/html/mod_menu/default.php

4.重写、新建LESS

在{root}/templates/purity_iii/local/less下创建一个less文件,

例如,你可以创建/local/less/template.less文件,这个文件中的风格会自动的被编译。

当LESS在编译到CSS后,被编译后的CSS文件将被保存到/local/css文件夹中。

5. 重写Logo

在local文件夹中创建images/logo.png,可以覆盖默认的LOGO。

6. 覆盖JS

从模板中复制JS文件

{root}/templates/purity_iii/js

粘贴到

{root}/templates/purity_iii/local/js

7. 新建CSS/JS

要新建CSS和JS文件,请先创建其父目录。

CSS文件:{root}/templates/purity_iii/local/css/

JS文件:{root}/templates/purity_iii/local/js/

然后复制etc/assets.xml文件到local/etc/文件夹中,在local/etc/assets.xml中定义CSS和JS

2

8.重写、扩展模板参数

要重写或扩展模板参数,请在/local/etc/assets.xml文件中执行,例如,在以下文件中, snippet_open_head参数将被改为非全局设置,这意味着,snippet_open_head参数只能适用于当前模板,全局中不再生效。

原文地址:https://www.cnblogs.com/kjitboy/p/7400997.html