| ||||||||||
Shopping cart software Solutions for online shops and malls | ||||||||||
|
X-Cart Home | FAQ | Forum rules | Calendar | Mark Forums Read | User manuals | Login |
Template Editing Guide for 4.1.x (updated Oct 2008) | |||
|
|
Thread Tools | Search this Thread |
#1
|
|||||||
|
|||||||
Template Editing Guide for 4.1.x (updated Oct 2008)
Template editing overview
X-Cart uses Smarty templates to display all of the pages in X-Cart. Each template controls a different part of the site, so there is no central file to edit to change the look of your site. I will list the major templates in the next section, along with what they control. You can also use Webmaster Mode to show you which template is which. You can read more about Webmaster Mode in the manual. The templates themselves are made up of HTML/CSS and Smarty. Dreamweaver has a plug-in that recognizes Smarty tags, which may help you: http://smartydwt.klitsche.org/ You need to be very careful when editing templates, as you can easily break the Smarty tags. Some pieces of a template only display when a certain condition is met. For example you may see a statement like this: {if $usertype eq "C"} a {else} b {/if} That essentially tells the browser to display 'a' if the usertype is C, or a Customer. Otherwise, it will display b. There are literally hundreds of these types of statements mixed in the templates. Soon you will get to know what each of them means. Good thread here on {if} statements: http://forum.x-cart.com/viewtopic.php?t=12234 Template Guide Below are the major templates in X-Cart along what what each controls. All of them are located in your skin1 directory, and I'll group them by the folder they are in, starting with the root folder:
Customer sub-directory
Customer/main sub-directory
Main sub-directory
Misc
Buttons - All of the buttons are controlled via the files in the Buttons sub-directory Modules - All of the modules (bestsellers, reviews, gift certificates, discount coupons, etc) all have their own folders in the skin1/Modules folder. Mail - All of the mail templates are in mail/ and mail/html. Most of you will use mail/html. All of the text in these templates can be controlled via the 'languages' area, so unless you want to edit the actual layout of the e-mail, you won't need to edit them. Please see the next post for some template editing guidelines....
__________________
Padraic Ryan Ryan Design Studio Professional E-Commerce Development |
|||||||
|
#2
|
|||||||
|
|||||||
Re: Template Editing Guide
General template editing notes
- Most of the text in X-Cart (such as the welcome text, error messages, titles of pages, button labels, etc) are controlled with Language Variables. The manual covers this fairly well. You can edit these variables in Webmaster Mode (by clicking on the green text) or by clicking on Languages in your admin menu. - When adding new content or formatting existing content, try to keep all of the formatting in the CSS file. For example, instead of this: <td bgcolor=blue> (the old way of doing it) use this: <td class="test"> and add .test {background-color: blue;} to your CSS file. Keeping the formatting in the CSS file decreases your page load time, and using the most current code keeps your pages displaying correctly in all browsers. (note: change 'test' to a class name that will be informative so you can keep track of them easily) - When calling images, be sure to use Smarty. Upload all of your graphic images (not the product images, they go elsewhere) into the skin1/images directory and call them using this format: <img src="{$ImagesDir}/imagename.jpg" alt="Alt text here" /> That keeps them from causing security warnings when the page is in secure mode. - To 'comment out' a line of code (if you don't want it to display, but might need it later), use this format: {* commented out code *} - You can edit templates in X-Cart itself, via FTP or in a text editor. Don't edit them via FrontPage or Cpanel, as extra code may get inserted that will screw up your layout - There is always a copy of the original template in skin1_original, although I recommend making incremental backups so you don't lose EVERYTHING you have been working on. One more thing - it is tough to work on X-Cart without the proper tools. You should be using Firefox with these extensions: - Firebug - Colorzilla - MeasureIt - Web Developer Toolbar Hope this answers some of your questions. Enjoy!
__________________
Padraic Ryan Ryan Design Studio Professional E-Commerce Development |
|||||||
|
|
Thread Tools | Search this Thread |
|
|
|
|||
X-Cart forums © 2001-2020
|