$7.49 .com domain with free InstantPage Website Builder$1.99 Web Hosting   捷飞网络官方淘宝店   Godaddy 优惠码
返回列表 发帖
分享到:




[模板风格/教程] [ZC二次开发] 英文商城之:如何设计自己的zencart模板

本帖最后由 jim9 于 2010-10-14 02:48 编辑
' D2 d2 K/ S0 w+ L: E
% d2 o! S) i. L, `7 Y最近一直在学习用zencart来做英文商城,只是自己的php知识有限,就只能在网上找资料来学习,下面这文章不错,有兴趣的朋友也可以看看很多朋友爱刚接触到zencart的时候总感觉太麻烦,特别是入门阶段,在安装后系统后,看到默认的模板自然是不会太喜欢,但一看到别人的很漂亮的站,又恨不能自己马上DIY一个模板出来,TOM在这收集了些从网络上找来的关于DIY你的 zencart模板需要了解的文档资料和对应的文件注释,希望对大家有帮助!& [) s# g# S) c
具体的认知步骤可以分为以下几点:
& H! C, d% B. p; i2 E6 U8 [首先要阅读常见问答部分的:如何添加、制作新模板。 ZenCart的设计没有什么特别,与以前设计HTML页面是一样的。只是整个页面分成了好几个部分,并加入了PHP代码。
/ {5 I9 O& _+ W9 {- f9 [9 [* l通常,页面分为页眉(header),页脚(footer),边框(sideboxes)。所以设计页面的时候,要记住ZenCart是如何组织这些页面的。
, H. f  L6 x0 v页面是通过CSS样式表来控制的。样式表控制表格单元的背景图案、字体的颜色和样式等等。所以,假如你需要修改边框标题栏的字体,那么查看样式表文件。1 t% F; B3 q6 `% W: P  `9 N& x
ZenCart在页面添加图像有两种方式。可以使用图像目录的相对路径,或者在模板中用php变量定义图像。如果你使用https服务器,并且采用相对图像路径,那么https的图像目录下也要有同样的图像,否则https服务器很可能会给出警告提示。zencart可以设置成任意的html/flash的界面,只是比通常的html页面的设计费时。你可以从修改缺省的模板开始,先修改CSS文件和三栏格式的界面。开始先采用不同的颜色,很快就可以设计出完全不同的风格。
) e5 y! E) {% o2 M最后,在设计模板前要先计划好你网页的内容,这样你的设计就会很快了。
+ R2 p& T( @/ @* t& t# f! g下面是zencart页面各部分相对应模板文件的一个列表:文件路径注释
7 y- [0 {, z* q: T7 i5 k+ {index.php主文件includes/templates/[custom template folder]/common/html_header.php% [3 a$ l; v4 W( ^! U  m* c' U  Z5 D
页面的head部分includes/templates/[custom template folder]/common/tpl_main_page.php) s7 I. {7 z( k5 y8 ^* \7 A7 S
页面的body部分includes/templates/[custom template folder]/common/tpl_header.php; Z* r. @( l! b5 l& y9 |* z, F4 \
所有页面的页眉(column left)includes/templates/[custom template folder]/common/main_template_vars.php- `% `( k6 d' V# Q# W" X8 o7 ?2 L
决定页面的内容部分,缺省为 'tmp_index_default.php'首页 – 缺省includes/templates/[custom template folder]/templates/tmp_index_default.php: p0 X- Y1 r% A  C
首页模板文件首页 – 显示分类includes/templates/[custom template folder]/templates/tpl_index_categories.php
- W6 y# C3 M' Y9 p7 @首页上显示分类时的模板文件includes/modules/[custom template folder]/pages/index/category_row.php; X3 u% ~2 M/ Q$ D4 Z, m
选择要显示的分类includes/templates/[custom template folder]/templates/tpl_index_category_row.php: v1 {. X- ^' a: L+ m* _3 i& s
显示分类首页 – 显示指定分类includes/templates/[custom template folder]/templates/tpl_index_product_list.php3 N; D5 G# J$ }3 K; O  x5 j
首页上显示指定的分类时采用的模板文件includes/modules/[custom template folder]/product_listing.php
% x& l& _& S4 H6 h9 ?将商品数据添加到数组includes/templates/[custom template folder]/templates/tpl_modules_product_listing.php+ A- C3 K6 v8 b& V% w2 D8 r
显示商品数量和商品导航菜单includes/templates/[custom template folder]/common/tpl_list_box_content.php8 R  ~) C9 |2 d- ^7 ?/ X; X
显示商品数组商品信息页面includes/templates/[custom template folder]/templates/tpl_product_info_display.php% d  Y5 p9 E# y% R9 O+ Z4 k
显示单件商品信息购物车页面includes/templates/[custom template folder]/templates/tpl_shopping_cart_default.php
6 {! c+ I4 h/ l购物车页面(column right)includes/templates/[custom template folder]/common/tpl_footer.php
2 X7 n9 C. m+ x, Z; g所有页面的页脚

美国VPS、域名代购:http://tu8l.taobao.com

返回列表
Namecheap
Namecheap.com - Cheap domain name registration, renewal and transfers - Free SSL Certificates - Web Hosting
互联网安全