zen cart 模板制作流程指南_第1页
zen cart 模板制作流程指南_第2页
zen cart 模板制作流程指南_第3页
zen cart 模板制作流程指南_第4页
zen cart 模板制作流程指南_第5页
已阅读5页,还剩12页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、zencart模板制作流程指南how do i create a new custom template?first, you need to make a new directory for your custom template files.open: includes/templates/ and add a folder. (you may call it anything you want, but in this faq we will be calling it my_template.)create an empty folder inside your new templa

2、te directory and call it images . so you should have includes/ templates/ my_template/ images/.next, copy the includes/ templates/ template_default/ css directory from includes/ templates/ template_default/ and place the new folder and its files in your new includes/ templates/ my_template/ folder.c

3、opy the stylesheet.css from includes/ templates/ template_default/ css to includes/ templates/ my_template/ css. this si the stylesheet you will be editing.then you copy the file called includes/ templates/ template_default/ template_info.php, and put it inside includes/ templates/ my_template/.next

4、 open includes/ templates/ my_template/ template_info.php in your favorite text editor.change = default theme; to = my custom template; add your own version, author and descrption. upload it to includes/ templates/ my_template/.now go to the admin.in the admin, point your cursor at tools on the menu

5、 bar, click on template selection, click the edit button, then choose my custom template from the dropdown menu and click the update button.the last step is to point your cursor at the tools menu again. from the menu choose layout boxes controller, and the bottom of the page click on the reset butto

6、n.how do i change the text zen cart! the art of e-commerce that shows in my browser bar?open your admin. place your cursor over tools in the top menu bar. choose developers tool kit from the dropdown menu. put the phrase or part of the phrase you are looking for in the input box on the lower left. f

7、or example zen cart! choose all files- catalog and admin click the search button. all the files that contain that phrase will show in a list at the top. in this case you are looking for: your_directory/includes/languages/english/meta_tags.php line #10 : define(title, zen cart!); how do i set up the

8、template overrides?by networkdadive been watching the forums, and im seeing many users make many modifications to their cart. this is great!however, im also seeing users of zen cart talk about making changes to important files such as:/includes/filenames.php/includes/languages/english.php/includes/l

9、anguages/english/*.phpand many others.just a warning and note - you should not be modifying these files, if you want future upgrades to be seamless!there is a file over-ride system in place that works very well, and makes it so you do not have to modify the core files.if you have modified these file

10、s, the next time you go to upgrade to the latest release of zen cart you will over-write these files and lose your changes.ok, so how do you avoid this problem, and whats the right way to use the over-rides system?below, ive written up steps on how to use the system correctly - and not modify your c

11、ore files!all of my examples below assume*you are using the english language. you get the idea for your own language.*the example template name is customoriginally posted by drbytethe custom folder/directory can be whatever you want it to be. just be consistent in all places where you create it so t

12、hat the overrides work properly.you could call it anything like:- mytemplate- custom- billg- helluvacart- zenrocks- thisseemstoolongatemplatename- supercalifragilisticexpialidocious- tpland the list goes on !addendums & disclaimers: if ive missed something, or told you something incorrectly, please

13、let me know and ill modify this post! no warranties expressed or implied. no refunds without receipt after 30 days!*note, be sure to also read the faq on how do i add/create a new template set?*modifying the default language file - /includes/languages/english.phpexample: you need to modify the units

14、 of measure used for your shop from lbs to kgsmake a directory with the same name as your template name in /includes/languages, so you now have /includes/languages/custom.copy english.php to this directory.then, you can make any needed modifications in your new:/includes/languages/custom/english.php

15、:modifying language files - /includes/languages/english/*.php (all files within this dir)example: you need to modify some text in account.php - lets say you want to change every instance of the word account to profilemake a directory with the same name as your template name. assume your template nam

16、e is custom. this directory path would be:/includes/languages/english/customcopy the original file /includes/languages/english/account.php to this new folder, /includes/languages/english/customthen, modify the file in the custom folder. this will over-ride the existing file in /includes/languages/en

17、glish, thereby leaving the core file intact and alone.another example: in /includes/languages/custom/meta_tags.php:define(title, zen cart!);becomes:define(title, your store name!);modifying template files - /includes/templates/template_default/templates/tpl_*_default.phpexample: you need to modify s

18、ome html in tpl_account_default.phpin your templates directory ( /includes/templates/custom ) you should already have a folder templates ( /includes/templates/custom/templates ).copy tpl_account_default.php to this directory. you can then make your changes, and it will again over-ride the base file

19、in /includes/templates/template_default/templates directory.you should only copy files over to your custom template directory that you make modifications to. if you do not make modifications, then by default, the shop will call the default file from the template_default directory.modifying sidebox t

20、emplatesthese follow the same format as your regular templates (see above), with the exception of the sidebox path:/includes/templates/custom/sideboxesmodifying sideboxes - /includes/modules/sideboxes/*.phpexample: you need to modify sidebox information.php to include another link.in your sidebox di

21、rectory (/includes/modules/sideboxes), create another subdir with the same name as your template custom, so you now have /includes/modules/sideboxes/customcopy information.php to this new folderyou can then modify information.php to suit your needs, and it will over-ride the default information.php

22、in /includes/modules/sideboxesyou can verify this sidebox is being over-ridden by logging into admin - tools - layout boxes controller. in the column, box file name, if the text appears in red, it is being over-ridden.calling custom file names - /includes/filenames.phpexample: you create a custom pa

23、ge, about_us and need to call the filename.rather than putting a new define in /includes/filenames.php, you should call the filename from the existing directory,/includes/extra_datafiles.create a new filename, about_us_filenames.php and place this file in /includes/extra_datafiles.in this file, you

24、would have the code:this file will be called automatically, as would any other file in this directory, thereby telling the system what your custom filenames are.try and keep the same format for other new files you make.example, calling a file named blah would be namedblah_filenames.phpcalling custom

25、 database tables - /includes/database_tables.phpexample: you create a new database field for your ups tracking system, ups_track and need to define the table name for your code.rather than putting a new define in /includes/database_tables.php, you should call the table name from the existing directo

26、ry, /includes/extra_datafiles.create a new filename, ups_track_database_tables.php and place this file in /includes/extra_datafiles.in this file, you would have the code:code:this file will be called automatically, as would any other file in this directory, thereby telling the system what your custo

27、m database tables there are.extra language filesexample: you need an extra file to call extra language definitions for a new box you created, resource centerin /includes/languages/english/extra_definitions, you would create a file named resource_center_box_defines.php. in this file, you would put al

28、l language definitions for your new custom sidebox.this directory automatically gets loaded, ensuring your language definitions for custom boxes or pages are called.adding extra javascrpt to an existing fileexample: you need to load some javascrpt for your bizrate account, so that it loads from the

29、existing page checkout_success.php after the order has completed.in the directory /includes/modules/pages/checkout_success, create a new file named jscrpt_bizrate.jsin this file, you would put your custom javascrpt code bizrate gave you, such as:code:same thing.if you were using googles conversion t

30、racker. create another file, maybe named jscrpt_google.phpcss file adds & modificationsexample: you have created a new css class for something unique for your site.rather than add this to your existing css file in /includes/templates/custom/css/stylesheet.css, create a new file in this same dir name

31、d stylesheet_yourfilename.css and add your css data in here.last, we need to talk about the subject of upgrades!so, youre now using the zencart over-rides system properly! congratulations, give yourself a pat on the back. now, an upgrade comes - you dont have to worry about it over-writing your cust

32、om files, because all of yours are in custom directories!so, you do your upgrade thing. what if new code was added to core files that you are over-riding? now, you can take your custom directories, and compare the code to the new core file.example, if you made customizations to your /includes/langua

33、ges/custom/english.php file, and now with the upgrade, there are some new defines in /includes/languages/english.php you obviously need to get those new defines into your english.phpthe easiest way of doing this is going to use a file comparing utilty!i highly recommend using beyond compare - yes, i

34、t costs $30 but it is worth far more than that!ok, if youre cheap, you can always go with winmerge, open source and free. sorry, i havent used it yet, but it looks like it would do the job.once youve got your filecomparing utiltiy, you can compare your /includes/languages/custom/english.php to the n

35、ew core file, /includes/languages/english.php and easily incorporate the new changes into your over-ride file.how do i find out what files to edit?i want to make changes to the text that shows up in _ spot on _ page. how do i find out what where it is, and what file to change?1. use a good search to

36、ol that can handle standard text files using a .php extension (wingrep is a great tool for this!)also available right on your zen cart admin area, under the tools menu, is the developers toolkit. you can enter the words youre looking for right there, and itll point out the files in just a couple sec

37、onds.2. search everything under the includes folder for the text you are trying to change/edit/delete.3. thatll show you the text inside a define statement much like this:define(text_greet_user,welcome to my site);4. this is where youll be making your changes. you should be sure to save the file acc

38、ording to the template overrides concept (see the overrides explained link below5. then use this article to be sure you put your changes into the right place:over-ride thread (how to protect your customizations)6. if you are desiring to modify the php code that uses the text you just located, then y

39、ou need to do another search - ie: for the text_greet_user (constant name that you just found), and find the files its used inthe logic for how to use that constant in another file will be there.also, itll reveal to you which files to consider for modifying as you desire.how do i use the developers

40、toolkit?say, for example, you wish to change the welcome email text because you do not plan to use the roduct reviews feature, and dont wish it to be advertised to your customers.1. look at the welcome email you received as a new customer.2. find the text in that email that you wish to change.in thi

41、s example, you desire to remove:products reviews - share your opinions on products with our other customers.3. copy a few of those words exactly to the clipboard. exampleuote: your opinions on products4. open the developers toolkit (admin-tools-developers tool kit )5. paste those words exactly as th

42、ey appeared on the email. into the first search box.6. from the first drop-down, choose all language files.7. click search8. youll find that the /includes/languages/english/create_account.php file is displayed with the exact line number where the text you desire to change is located.9. now open that

43、 file on your pc and make your changes.10. upload the changes back to your server.note: its recommended that you place your customized file in an overrides folder, like this:/includes/languages/english/yourtemplate/create_account.php.where yourtemplate is the name of the custom template youve been d

44、eveloping for your site.for more information on template overrides, see the other links in this faq.how do i add a new page?as an example to add a fully-templated and multi-lingual-supported page to your site, go to the downloads section and get the about us contribution.or, if youre using zen cart

45、v1.3.0, go to admin-tools-ez-pages and create your new pages there. to show links to these pages in your store, you may need to enable the various ez-pages sideboxes via the admin-tools-layout boxes controller.how do i change the text, -insert your phrase here- ?all of the text on each page is dynam

46、ically generated and can be easily changed. begin by locating the language file that has the same name as the page or module you want to change.for example, well use the first page (index.php). the file being used may be in one of 2 places depending on whether you are using the override directory or

47、 not. the phrase beginning with congratulations . is in: /includes/ languages/ english/ classic/ index.php.by being in /english/ classic/ directory, the index.php file overrides the includes/ languages/ english/index.php. the override system makes updating and changing the files in zen cart very fle

48、xible. by putting your customized language files in your own custom template directory, you never have to worry about them being over-written when updating your web site either.you can edit the file with your favorite text editor and then upload it via ftp.each pages language file has one or more de

49、fines. each define contains a constant that is used on the page. the constants may be a single word or a section of text. each define is set-up like:define(i_am_a_constant, i output this in your browser.);the text between the 2 single quotes can be modified or removed. you may use html tags or css c

50、lasses to modify and format the text, you can insert url links or add images (be sure to use relative paths).caution: if you use a contraction (cant, id, saras), you must put an escape in front of the apostrophe. the escape is a backslash .if you do not want to show something that is in a define, si

51、mply delete the text from between the 2 single quotes.for example: define(i_am_a_constant, );note: do not remove the define from the language file or you will break the code.for more information on the php define() function, visit: how do i get rid of the owered by zen cart and replace it with my lo

52、go?there are 2 ways to do this. if you are using an unmodified stock template and have a gif logo you can name your logo logo.gif and ftp it to the your_template/images/ directory.if you have made a custom template directory or want to change the logos image format, go to includes/languages/english/

53、classic/header.phpmake a copy of that file. edit the image name for your logo, make changes in the sales message text. save the file. ftp a new directory(name the directory the same as the template you are using) to includes/languages/english/ and then upload your new header.php to the new directory

54、.can i remove the copyright 200x zen cart. powered by zen cart from the footer of my cart?copyright 200x zen cart covers the design and graphics in the templates. if you are using a stock template with the included graphics you must leave the copyright. if you make a custom template and use your own

55、 graphics you may change the copyright.shops that wish to be listed in the zen showcase must leave powered by zen cart in the footer for identification.leaving the powered by zen cart is advantageous to both you and zen cart because a relevant reciprocal link can help you with search engine rankings

56、. in the event you do not wish to be listed in the zen showcase, powered by zen cart may be removed, but it may not be changed.how do i change the colors and fonts?start by opening the style sheet in your favorite text editor: /includes/templates/your_template/css/stylesheet.cssall of the pages are

57、broken into smaller pieces called classes and each class has a style. the class styles are used to control the look of your fonts, colors, text size, borders, background images, etc. change the colors by substituting standard html color numbers for the text and background colors. change the text size by increasing or decreasing the size

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论