If you wish to have your X-Cart alternate between a 2- and a 3-page layout, or if you wish to have a fixed-width home
page and variable width all other pages, here is the code that Instinctual of Instinctual and Norma of
Rightminddesigns so kindly provided. My cart has successfully been modified to do both of these things.
(1) How to have your X-Cart alternate between a 2- and a 3-page layout.
A. These instructions assume that you have your cart set up with a 3-column default layout.
B. Open customer/home.tpl. This should be the only file you have to modify.
C. Locate this comment: . This comment designates the beginning of what will be displayed in the
three columns that define your cart's layout.
D. Scroll down from there until you find this comment: . This comment designates the end of
what will be displayed in the center, or middle, column of your cart's layout.
E. Now look a few lines below that last comment. You are looking for a <TD> statement. This <TD> statement designates
the beginning of the third column of your cart's layout.
F. Immediately before that <TD> statement, insert this line of code
Code:
{if $main eq "catalog" and $current_category.category ne ""}
G. Now scroll down and find the ending </TD> statement.
H. Insert {/if} immediately below that </TD> statement.
I. The results (in my cart, at least):
1. Home Page = 3 cols.
2. Featured Product pages = 3 cols
3. Top level categories = 3 cols.
4. Secondary level categories = 3 cols.
5. Thumbnails = 3 cols.
6. Searches = 2 cols.
7. Product Details = 2 cols
8. All checkout pages = 2 cols.
9. And so forth.
J. Go here to see what this looks like in my cart:
www.bitsbytescomputer.com/store
(2) How to have your cart display a fixed-width home page and variable width all other pages.
A. These instructions assume that you have your cart set up with a 3-column default layout.
B. Open customer/home.tpl. This should be the only file you have to modify.
C. Locate this comment: . This comment designates the beginning of what will be displayed in the
three columns that define your cart's layout.
D. Scroll down from there until you find this comment: . This comment designates the beginning
of what will be displayed in the center, or middle, column of your cart's layout.
E. Now look a few lines below that last comment. You are looking for a <TABLE> statement. This <TABLE> statement
designates the beginning of the second and third column of your cart's layout.
F. Modify this <TABLE> statement so that it looks like this:
<TABLE border="0"
Code:
{if $main eq "catalog" and $current_category.category eq ""} width="650px" {else} width="100%" {/if}
cellpadding="0" cellspacing="0" class="twelvepoint">
G. Change the "650px" designation to whatever width you want your home page to be.
H. I also had to add this
Code:
{if $main eq "catalog" and $current_category.category eq ""} width="650px" {else}
width="100%" {/if}
logic in two other locations in my customer/home.tpl and I created tables to contain the include
statements in these locations (changing the fixed width to 833px to make everything look right):
1. <TABLE border="0"
Code:
{if $main eq "catalog" and $current_category.category eq ""} width="833px" {else} width="100%"
{/if}
cellpadding="0" cellspacing="0" class="twelvepoint">
<TR>
<TD>
{include file="customer/logo_bar.tpl"}
{include file="customer/tab_bar.tpl"}
</TD>
</TR>
</TABLE>
2. <TABLE border="0"
Code:
{if $main eq "catalog" and $current_category.category eq ""} width="833px" {else}
width="100%" {/if}
cellpadding="0" cellspacing="0" class="twelvepoint">
<TR>
<TD>
{include file="customer/bottom.tpl"}
</TD>
</TR>
</TABLE>
I. Go here to see what this looks like in my cart:
www.bitsbytescomputer.com/store
Instinctual and Norma are far better qualified to explain the if...then logic than am I.