If this is your first visit, check our documentation. To post, register or login.
Forums / Templates, Stylesheets, Page Layout / Making Custom Template

Making Custom Template

Locked

Started by rebelrose on 2 Jul 2006, 4:02 AM · Views: 17,571

Results 1 to 20 of 21
This thread is locked. New replies are disabled.
2 Jul 2006, 4:02 AM
#1
rebelrose avatar

rebelrose

New Zenner

Join Date:
Mar 2006
Location:
Louisiana
Posts:
42
Plugin Contributions:
0

Making Custom Template

I don't understand what I am reading I guess, I was looking at what I need to make a custom template and it seems to say I have to copy the css two times?

Is that correct?

This is what I am reading:

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.

Copy the stylesheet.css from includes/ templates/ template_default/ css to includes/ templates/ my_template/ css. This si the stylesheet you will be editing.

Respect other in order to be respected.

2 Jul 2006, 5:10 AM
#2
clydejones avatar

clydejones

Deceased

Join Date:
Nov 2005
Location:
Colorado Springs, CO USA
Posts:
7,017
Plugin Contributions:
12

Re: Making Custom Template

Its probably eaiser to explain it this way:

in includes -> templates

create your CUSTOM_NAME folder

Now in you should have something that looks like this:

includes -> templates -> CUSTOM_NAME

In CUSTOM_NAME create the following folders
common
css
images
templates

Now from your templates_default -> css

copy the stylesheet.css and paste it into:

CUSTOM_NAME -> css

If you have or create images for your CUSTOM_NAME template they should go in

CUSTOM_NAME -> images

You will also need a file called template_info.php that contains the following:

<?php
/*
*
 * Template Information File
 */
 
$template_name = 'custom_name';
$template_version = 'Version 1.0';
$template_author = 'your name';
$template_description = 'description of template';
$template_screenshot = '';
?>

Your finished folder should look like this:

CUSTOM_NAME

  • common (folder)
    css (folder)
    images (folder)
    templates (folder)
    template_info.php

Hope this helps

NOTE: We are sorry that Clyde is no longer with us.
We are grateful for all his contributions to the Zen Cart community.

2 Jul 2006, 5:12 AM
#3
rebelrose avatar

rebelrose

New Zenner

Join Date:
Mar 2006
Location:
Louisiana
Posts:
42
Plugin Contributions:
0

Re: Making Custom Template

Thank You that is much easier, I appreciate your time. I am trying to make my own template and the way things are explained here are a bit confusing.

Thank You

Respect other in order to be respected.

2 Jul 2006, 5:18 AM
#4
clydejones avatar

clydejones

Deceased

Join Date:
Nov 2005
Location:
Colorado Springs, CO USA
Posts:
7,017
Plugin Contributions:
12

Re: Making Custom Template

Just take your time and read through both the FAQs and the Wiki. It seems complicated but once you get over the first hurdle things become eaiser.

NOTE: We are sorry that Clyde is no longer with us.
We are grateful for all his contributions to the Zen Cart community.

2 Jul 2006, 5:20 AM
#5
rebelrose avatar

rebelrose

New Zenner

Join Date:
Mar 2006
Location:
Louisiana
Posts:
42
Plugin Contributions:
0

Re: Making Custom Template

Well if you say so, but this is all greek to me. Code is something I just don't understand well.

But Thank You

Respect other in order to be respected.

2 Jul 2006, 5:54 AM
#6
clydejones avatar

clydejones

Deceased

Join Date:
Nov 2005
Location:
Colorado Springs, CO USA
Posts:
7,017
Plugin Contributions:
12

Re: Making Custom Template

Don't get lost in the forest of "code". You don't have to write code and in any case if you need help changing something in one of your template files you can always ask for help here in for forum.

In the meantime maybe these hints and tips will help a little bit.

How do I change the background header?

Using an image editor, create a new background graphic and save it to includes -> templates -> YOUR_TEMPLATE -> images -> header_bg.jpg and upload it to your server.


How do I add and position a new logo?

Using an image editor create your new logo and save it to includes -> templates -> YOUR_TEMPLATE -> images -> logo.gif and upload it to your server.
By default the logo is Left aligned. Changing the alignment involves making a modification to your stylesheet.css. Open the stylesheet.css and find the following:

#logo, .centerBoxContents, .specialsListBoxContents, .categoryListBoxContents, .centerBoxContentsAlsoPurch, .attribImg {
float: left;
}

and change it to

#logo {float: left;}/* Make your changes here (i.e. to center the logo change float: left; to text-align: center; or you can align it to the right by changing float: left; to float: right;) */

.centerBoxContents, .specialsListBoxContents, .categoryListBoxContents, .centerBoxContentsAlsoPurch, .attribImg {
float: left;
}


How do I remove the logo completely?

If you don't want or need a logo, use your image editor and create a 1px by 1px transparent image and save it to includes -> templates -> YOUR_TEMPLATE -> images -> logo.gif and upload it to your server.


How do I change the "sales message goes here"/"TagLine Here" text?

In order to add your own "sales text", changes will have to be made in includes -> languages -> English (or YOUR LANGUAGE) -> header.php.
Open the file in a text editor and find the following line of code:

define('HEADER_SALES_TEXT', 'TagLine Here');

Make your changes to the text highlighted in red. Save the file and copy it to the includes -> languages -> English (or YOUR LANGUAGE) -> YOUR_TEMPLATE folder and upload it to your server.


How do I change Congratulations! You have successfully installed your Zen Cart™ E-Commerce Solution?

look in includes -> languages -> english -> index.php and find this:

// This section deals with the "home" page at the top level with no options/products selected
/Replace this text with the headline you would like for your shop. For example: 'Welcome to My SHOP!'/
define('HEADING_TITLE', 'Congratulations! You have successfully installed your Zen Cart™ E-Commerce Solution.');
} elseif ($category_depth == 'nested') {
// This section deals with displaying a subcategory
/Replace this line with the headline you would like for your shop. For example: 'Welcome to My SHOP!'/
define('HEADING_TITLE', 'Congratulations! You have successfully installed your Zen Cart™ E-Commerce Solution.');
}

change the portions in red to whatever you want.


How do I change or turn off "Welcome Guest" message?

To turn off the Customer Greeting go to your admin -> configuration -> layout settings -> Customer Greeting - Show on Index Page and set to 0.
If you want to have your own customized greeting, You will have to make changes in includes -> languages -> English (or YOUR LANGUAGE) -> index.php.
Open the file in a text editor and find the following lines of code:

if (STORE_STATUS == '0') {
define('TEXT_GREETING_GUEST', 'Welcome <span class="greetUser">Guest!</span> Would you like to <a href="%s">log yourself in</a>?');
} else {
define('TEXT_GREETING_GUEST', 'Welcome, please enjoy our online showcase.');
}
define('TEXT_GREETING_PERSONAL', 'Hello <span class="greetUser">%s</span>!');

Make your changes to the text highlighted in red. Save the file and copy it to the includes -> languages -> English (or YOUR LANGUAGE) -> YOUR_TEMPLATE folder and upload it to your server.


How do I remove the Home in the middle column next to the Categories box?

This is called the breadcrumb (think Hansel and Gretel) showing where you are and how to get back to previous locations. You can either turn it off completely or you can turn it off only on the main page.

You can turn it off in admin -> configuration -> layout settings -> Define Breadcrumb Status and set to 0.

To turn it off on the main page in includes -> templates -> YOUR_TEMPLATE -> templates -> common -> tpl_main_page.php find the following lines of code

<!-- bof breadcrumb --> <?php if (DEFINE_BREADCRUMB_STATUS == '1') { ?>
<div id="navBreadCrumb"><?php echo $breadcrumb->trail(BREAD_CRUMBS_SEPARATOR); ?></div>
<?php } ?> <!-- eof breadcrumb -->

and change to:

<!-- bof breadcrumb --> <?php if (DEFINE_BREADCRUMB_STATUS == '1' && ($current_page!='index' || (int)$cPath>0 )) { ?> <div id="navBreadCrumb"><?php echo $breadcrumb->trail(BREAD_CRUMBS_SEPARATOR); ?></div> <?php } ?> <!-- eof breadcrumb -->

How do I change Copyright © 2003-2006 Zen Cart in the footer?

in includes -> languages -> YOUR_TEMPLATE -> english.php find the following:

define('FOOTER_TEXT_BODY', 'Copyright © 2006 <a href="http://www.zen-cart.com" target="_blank">Zen Cart</a>. Powered by <a href="http://www.zen-cart.com" target="_blank">Zen Cart</a>');

Make your changes to the portion in red. As a bow to the developers of Zen Cart leave the powered by portion as is.


Additional customizations would be made in your template files. In general terms these would be the only files you would modify but, occasionaly you will also need to modify your stylesheet.css as well.


Where do I find the files I would edit to change other parts of my cart (ie. template files, sideboxes, etc.)?

If you want to turn your sideboxes on and off or move them left and right, you do this from the admin control panel in admin ->tools -> layout boxes controller.

The other files you would modify are located in includes -> templates -> YOUR_TEMPLATE.

Which file(s) you edit will depend on which page of your shop you want to customize. Working with these files is fairly easy since they are clearly marked with <!--bof whatever--> and <!--eof whatever-->. This makes moving sections of the file easy.
The most common file(s) to be customized are:
includes -> templates -> YOUR_TEMPLATE -> common -> tpl_main_page.php
includes -> templates -> YOUR_TEMPLATE -> common -> tpl_header.php
includes -> templates -> YOUR_TEMPLATE -> common -> tpl_footer.php
includes -> templates -> YOUR_TEMPLATE -> templates -> tpl_product_info_display.php


How do I change the of sidebox titles?

Look in includes -> languages -> english.php

Find this line:
define('BOX_HEADING_XXXXXXXX', 'whatever');
in this case find:
define('BOX_HEADING_CATEGORIES', 'Categories');

Change the portion in red to whatever you need.

Save the modified file to includes -> languages -> YOUR_TEMPLATE and upload it to your server.


Again, a lot of your basic customization can be done in your admin control panel. Generally, you would do this in:

admin -> configuration
admin -> catalog -> product type -> product - general -> Edit Layout
admin -> tools -> layout boxes controller

As you can see, customizing your cart will take a bit of work and time but well worth the effort to get your cart looking the way you want.


What directories are all the images? ( ie. buttons, icons, images etc.)?

admin -> images folder:
admin -> images -> flags folder:
admin -> images -> graphs folder:
admin -> images -> icons folder:
images folder: This is where your Product images are located.
includes -> languages -> english [or YOUR_LANGUAGE] -> images folder: icon.gif (your language flag).
includes -> templates -> YOUR_TEMPLATE -> buttons -> english [or YOUR_LANGUAGE] folder: contains the buttons used by the cart.
includes -> templates -> YOUR_TEMPLATE -> images folder: contains header_bg.jpg, logo.gif and other images required by your template files.
includes -> templates -> YOUR_TEMPLATE -> images -> icons folder: contains additional images used by the cart


NOTE: We are sorry that Clyde is no longer with us.
We are grateful for all his contributions to the Zen Cart community.

2 Jul 2006, 6:32 AM
#7
ladysaat avatar

ladysaat

Zen Follower

Join Date:
May 2006
Location:
Anywhere USMC points
Posts:
330
Plugin Contributions:
0

Re: Making Custom Template

Wow Clyde that was awesome! I am half tempted to print that for crying out loud. LMAO! I still forget most of where that stuff is...:thumbsup:

The ART of Zen ; man I wish I was an ARTIST!~!

Donate $5 a month, you spend more for NOTHING at McDonalds!

2 Jul 2006, 5:57 PM
#8
rebelrose avatar

rebelrose

New Zenner

Join Date:
Mar 2006
Location:
Louisiana
Posts:
42
Plugin Contributions:
0

Re: Making Custom Template

clydejones:

Don't get lost in the forest of "code". You don't have to write code and in any case if you need help changing something in one of your template files you can always ask for help here in for forum.

In the meantime maybe these hints and tips will help a little bit.

Thank you so much for all of that, I am going to print that out.

Thank You

Respect other in order to be respected.

16 Jul 2006, 4:05 PM
#9
ziggy avatar

ziggy

New Zenner

Join Date:
Jun 2006
Posts:
11
Plugin Contributions:
0

Re: Making Custom Template

Thanks for that summary. It really helped a lot. :thumbsup:

19 Jul 2006, 2:57 PM
#10
mommydesigns avatar

mommydesigns

Zen Follower

Join Date:
Jul 2006
Posts:
135
Plugin Contributions:
0

Re: Making Custom Template

I followed your notes above to center my header.gif and no luck. :(

this is my site:

http://saab.websitewelcome.com/~azure/

I know this is straight forward but I'm having a heck of a time - i think I've been looking at it too much this a.m. and that's my trouble KWIM?

Thanks for your help.

19 Jul 2006, 4:18 PM
#11
designsbytrina avatar

designsbytrina

New Zenner

Join Date:
Jul 2006
Location:
Kentucky
Posts:
34
Plugin Contributions:
0

Re: Making Custom Template

Hi :)

I've been reading through several topics, went to the wiki, and can't find (or don't recognize) the solution to my need. I just want to add a creditcard.gif to one of the sideboxes, or in something that shows on every page. Doesn't need to link to anything, I only want to inform my customers that I accept certain credit cards.

I know a little html, but I'm lost in php. If anyone has an answer, please talk to me like I'm in kindergarten.

19 Jul 2006, 4:24 PM
#12
tinas avatar

tinas

Totally Zenned

Join Date:
Jan 2005
Location:
Lake Havasu, AZ
Posts:
1,090
Plugin Contributions:
0

Re: Making Custom Template

Have you tried the contribution for creating a new side box? I haven't used it yet so I don't know if it would help or how hard it is to do. But, since it is available in the downloads area it must work good and I am sure that it wouldn't be hard to figure it out.

When the world gets in my face I say Have A Nice Day.

19 Jul 2006, 4:34 PM
#13
ziggy avatar

ziggy

New Zenner

Join Date:
Jun 2006
Posts:
11
Plugin Contributions:
0

Re: Making Custom Template

mommydesigns, Surrond your anchor with <center> and </center>.

4 Sep 2006, 8:50 PM
#15
linkedla avatar

linkedla

New Zenner

Join Date:
Mar 2005
Location:
Bogotá, Colombia
Posts:
32
Plugin Contributions:
1

Re: Making Custom Template

clydejones:

Don't get lost in the forest of "code". You don't have to write code and in any case if you need help changing something in one of your template files you can always ask for help here in for forum.

In the meantime maybe these hints and tips will help a little bit.

Thanks Clyde for sure it help me to make a very nice custom template since i can now find what to change and where, i hope this still the samne in the new 1.3.5 i am sure it will be this way, also a small question her, you think i can have a flash movie for the repalcement of the greting message, a client of mine want a page with some flash in this place, and i just wondering if some one try this before. :blush:
Thanks for your help.

Visit https://www.colombianhandcrafts.org, we are in the fair trade move!

4 Sep 2006, 11:14 PM
#16
andysim avatar

andysim

New Zenner

Join Date:
Sep 2005
Location:
Los Angeles California
Posts:
1
Plugin Contributions:
0

Re: Making Custom Template

Thanks for all answer. They made me to understand much easier.
I have one more question to costomize.

How could I change the position to center.
I set width 850px and would like to align center rather than left.

I am trying with v1.3.0.2

Thanks again.
Andy Sim

5 Sep 2006, 1:10 AM
#17
clydejones avatar

clydejones

Deceased

Join Date:
Nov 2005
Location:
Colorado Springs, CO USA
Posts:
7,017
Plugin Contributions:
12

Re: Making Custom Template

linkedla:

Thanks Clyde for sure it help me to make a very nice custom template since i can now find what to change and where, i hope this still the samne in the new 1.3.5 i am sure it will be this way, also a small question her, you think i can have a flash movie for the repalcement of the greting message, a client of mine want a page with some flash in this place, and i just wondering if some one try this before. :blush:
Thanks for your help.

I've seen a few sites that use Flash, but I'm not familiar enough with it to give you a good answer on how to implement it.

You might do a search for Flash and see what turns up.

NOTE: We are sorry that Clyde is no longer with us.
We are grateful for all his contributions to the Zen Cart community.

20 Sep 2006, 5:41 PM
#18
pleitch avatar

pleitch

New Zenner

Join Date:
Aug 2006
Posts:
40
Plugin Contributions:
0

Re: Making Custom Template

I had one heck of a time trying to figure out the templating system when I first started working with ZenCart. I was taking an existing site design and wanted to recreate it with ZenCart to provide a seamless experience for users from the existing site to the store.

Eventually it worked best to create a new folder in templates with my theme name.

includes/templates/MY_THEME_NAME

from there i started one file at a time using the override system but first I took my existing CSS file from the current site and added that using the Zen Cart naming convention. So I made a new folder and added my file.

/includes/templates/MY_THEME_NAME/css/stylesheet_MY_THEME_NAME.css

I DID NOT copy the Zen Cart css from default_template as many of the people suggest. All of the Zen Cart features will merely display with no style at all, which in most cases is going to be better for you.

Along the way you can either use the Zen Cart ID and class names to add to your css or do like I did and in many cases remove them. They throw a lot of extra css in there that you really don't need (though you might in some cases). Most of the time I am deleting the Zen Cart ID/classes and using my own cleaner markup. Do what you're comfortable with.

So, now I have a folder with my theme name and a css folder within that with my css from an existing design. If you're starting with a new design I'd suggest building it in static HTML first (don't worry about Zen Cart yet, just get your design made) and then use that css file to begin.

Now I took took a look at my store, viewed the source and started figuring out which template files I needed to copy to my theme folder.

Likely you'll create your own copies of the following files from template_default/common:

  • tpl_main_page.php
    tpl_header.php
    html_header.php
    tpl_columnar_display.php
    tpl_tabular_display.php
    Those are the ones I've used at least as well as about 10-15 from /sideboxes and /templates. Each site will be different based on your design and needs.

I would only copy one file at a time by opening it from /includes/template/template_defulat and saving into the same structure within my new theme folder I had made.

To override tpl_main_page.php I saved my version to /includes/themes/MY_THEME_NAME/common/tpl_main_page.php

Essentially, any file Zen Cart finds in your theme folder will end up being ignored from the template_defaults. So any that you don't copy, Zen Cart will use the one in template_defaults.

It isn't as hard as the horrible documentation or some of the examples people post make it seem.

Just step back and look at it in simple, smaller chunks and you will figure it out. I did after much frustration trying to use the wiki or these forums (though the forums have been very helpful in other regards). Once I forgot what I had read and tried to figure it out by myself it worked much better.

If you don't need to change something in a template, DON'T COPY IT to your theme folder. Simple as that.

I'm planning to put something a bit more organized together once I finish the store I'm working on. I really like Zen Cart but have to admit it has been horribly frustrating and I've been building sites for over 10 years. I can imagine how miserable somebody with little to no experience would feel trying to work with it.


Letting Zen Cart give me migraines since '06!

Phil Leitch
http://unwounddesign.com

20 Sep 2006, 5:45 PM
#19
tinas avatar

tinas

Totally Zenned

Join Date:
Jan 2005
Location:
Lake Havasu, AZ
Posts:
1,090
Plugin Contributions:
0

Re: Making Custom Template

clydejones:

I've seen a few sites that use Flash, but I'm not familiar enough with it to give you a good answer on how to implement it.

If you want flash on the main page such as this site

You will want to use the tutorial for embedding flash that doesn't get caught by the IE problems of click to play : http://www.zen-cart.com/forum/showthread.php?t=34807&highlight=java+flash

What I did for the Patterson Photo's site was put my flash and my javascript in the root and then simply referenced those two files as /patterson.js and /patterson.swf

Hope that helps !

When the world gets in my face I say Have A Nice Day.

1 Oct 2006, 2:05 AM
#20
confusediam avatar

confusediam

New Zenner

Join Date:
Nov 2005
Posts:
27
Plugin Contributions:
0

Re: Making Custom Template

clydejones:

....

CUSTOM_NAME

  • common (folder)
    css (folder)
    images (folder)
    templates (folder)
    template_info.php

Hope this helps

Hi, I have done this but when in the Amin section and I go to choose the new template it is not there to be chosen. Other than that not being handy, I think I must be missing a step. Any ideas on what I am missing and not doing?

One thing that maybe is messing it up, when I uploaded all the files and did an install I got the store page saying it was sucessfully installed but lower on the page were warnings about files not there. Upon looking I found file names had been chopped off. I thought I went through all folders and corrected that, completing the file names but maybe I missed one or more and that might be the problem??? If so, could I just now upload the files all anew to 'catch' any I might have overlooked? I unstuffed the installer files and have them with complete file names on a local computer that I could upload just the files. (not sure running the installer does something extra to them and this would not work)

Thanks,
Rand