View Single Post
  #1  
Old 09-30-2005, 11:41 AM
  JJH1947's Avatar 
JJH1947 JJH1947 is offline
 

Advanced Member
  
Join Date: Feb 2004
Location: Whitefish, Montana
Posts: 41
 

Default Alternating between 2- and 3-column layouts

I would like to be able to alternate between 2- and 3-column layouts on my X-cart site. Although this topic has been discussed briefly, and although one member has graciously provided some help, I still am stuck.

I would like to display a 3-column layout on all pages _except_ the following, which are listed with the tpls that are invloved:

(1) Your Shopping Cart
A. customer/main/cart.tpl
B. customer/main/cart_totals.tpl

(2) Product Detail Page
A. customer/main/product.tpl

(3) Checkout
A. customer/main/checkout.tpl
B. customer/main/customer_details.tpl
C. customer/main/cart_details.tpl
D. customer/main/cart_contents.tpl
E. customer/main/cart_totals.tpl

(4) Wish List
A. modules/Wishlist/wishlist.tpl
B. modules/Wishlist/wl_products.tpl

I realize that what I am trying to achieve requires adding some if...then code to home.tpl. It is the specific if...then code I ned help with.

Thanks in advance to anyone who can assist.

John

www.bitsbytescomputer.com/store


In case it helps, here is my home.tpl file:

{* $Id: home.tpl,v 1.10.2.1 2003/12/02 11:33:47 svowl Exp $ *}
{ config_load file="$skin_config" }
<html>
<head>

<title>{$lng.txt_site_title}
{if $main eq "catalog"}
{$lng.txt_subtitle_home}
{elseif $main eq "help"}
{$lng.txt_subtitle_help}
{elseif $main eq "cart"}
{$lng.txt_subtitle_cart}
{elseif $main eq "checkout"}
{$lng.txt_subtitle_checkout}
{elseif $main eq "order_message"}
{$lng.txt_subtitle_thankyou}
{/if}
</title>

{ include file="meta.tpl" }
<link rel="stylesheet" href="{$SkinDir}/customer/style_customer.css">

{* JJH 04.02.05 *}
<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />
{* JJH 04.02.05 *}

{* AW suppport for categories tabs *}
{if $tab_cat}
{if $tab_cat == '1'}
{assign var="tab_nav" value="customer/tab_nav/software_nav.tpl"}
{elseif $tab_cat == '2'}
{assign var="tab_nav" value="customer/tab_nav/books_nav.tpl"}
{elseif $tab_cat == '3'}
{assign var="tab_nav" value="customer/tab_nav/audio_nav.tpl"}
{elseif $tab_cat == '4'}
{assign var="tab_nav" value="customer/tab_nav/kids_nav.tpl"}
{elseif $tab_cat == '5'}
{assign var="tab_nav" value="customer/tab_nav/services_nav.tpl"}
{elseif $tab_cat == '6'}
{assign var="tab_nav" value="customer/tab_nav/resources_nav.tpl"}
{else}
{assign var="tab_nav" value="customer/tab_nav/welcome_nav.tpl"}
{assign var="tab_cat" value=""}
{/if}
{else}
{if $current_category.categoryid == '' || preg_match("|^Welcome|", $current_category.category) }
{assign var="tab_nav" value="customer/tab_nav/welcome_nav.tpl"}
{assign var="tab_cat" value=""}
{/if}
{if $current_category.categoryid == '1' || preg_match("|^Software|", $current_category.category) }
{assign var="tab_nav" value="customer/tab_nav/software_nav.tpl"}
{assign var="tab_cat" value="1"}
{/if}
{if $current_category.categoryid == '2' || preg_match("|^Books|", $current_category.category) }
{assign var="tab_nav" value="customer/tab_nav/books_nav.tpl"}
{assign var="tab_cat" value="2"}
{/if}
{if $current_category.categoryid == '3' || preg_match("|^Audio|", $current_category.category) }
{assign var="tab_nav" value="customer/tab_nav/audio_nav.tpl"}
{assign var="tab_cat" value="3"}
{/if}
{if $current_category.categoryid == '4' || preg_match("|^Kid|", $current_category.category) }
{assign var="tab_nav" value="customer/tab_nav/kids_nav.tpl"}
{assign var="tab_cat" value="4"}
{/if}
{if $current_category.categoryid == '5' || preg_match("|^Services|", $current_category.category) }
{assign var="tab_nav" value="customer/tab_nav/services_nav.tpl"}
{assign var="tab_cat" value="5"}
{/if}
{if $current_category.categoryid == '6' || preg_match("|^Resources|", $current_category.category) }
{assign var="tab_nav" value="customer/tab_nav/resources_nav.tpl"}
{assign var="tab_cat" value="6"}
{/if}
{/if}
{* /AW *}

{ include file="customer/subtab_css.tpl" }

</head>

<body>

{include file="customer/logo_bar.tpl"}
{include file="customer/tab_bar.tpl"}

{*jjh -- 05.17.04 -- Do not add a style margin-right setting below because it introduces a horizontal scroll bar on all pages and whitespace to the right of the tab and subtab rows *}

<table border="0" width="100%" cellpadding="0" cellspacing="0" align="center">
<tr>

{* jjh -- 05.17.04 -- the first width setting below determines abount of whitespace to left of left edge of boxes in navigation menu column*}

{* jjh -- 05.17.04 -- the second width setting below determines the width of the items in the Navigation Menu column. Does the 168px width setting above need to match that in /customer/menu.tpl *}

<td width="1px" rowspan="2"><span class="space"><nobr>{**}</nobr></span>
</td>

<td width="168px" valign="top">


{* if isset($smarty.request.cat) && $smarty.request.cat neq '0' *}
{ if isset($smarty.request.cat) || isset($current_category) }
{* include file="customer/categories.tpl" --- Original *}
{ include file="customer/set_categories.tpl" }
{ include file="customer/set_categories_1.tpl" }
<div class="spaceafternavbox"></div>
{/if}


{if $current_category.categoryid == '' || preg_match("|^Welcome|", $current_category.category) }
{include file="customer/nav_home.tpl"}
{elseif $current_category.categoryid == '1' || preg_match("|^Software|", $current_category.category) }
{include file="customer/nav_software.tpl"}
{elseif $current_category.categoryid == '2' || preg_match("|^Books|", $current_category.category) }
{include file="customer/nav_books_bibles.tpl"}
{elseif $current_category.categoryid == '3' || preg_match("|^Audio|", $current_category.category) }
{include file="customer/nav_audio_video.tpl"}
{elseif $current_category.categoryid == '4' || preg_match("|^Kid|", $current_category.category) }
{include file="customer/nav_kids_stuff.tpl"}
{elseif $current_category.categoryid == '5' || preg_match("|^Services|", $current_category.category) }
{include file="customer/nav_services.tpl"}
{elseif $current_category.categoryid == '6' || preg_match("|^Resources|", $current_category.category) }
{include file="customer/nav_resources.tpl"}
{else}
{include file="customer/nav_other.tpl"}
{/if}


{* jjh - 05.19.04 -- I commented out the requirement about being logged in so that the Bestseller box always is displayed *}

{* jjh 09.24.05 moved bestsellers to right-hand column
{if $active_modules.Bestsellers ne "" and $config.Modules.bestsellers_menu eq "Y" }
{ include file="modules/Bestsellers/menu_bestsellers.tpl" }
{/if}
*}

{* include file="customer/quest.tpl" *}

{* jjh *}

{* jjh 09.24.05 moved recently-viewed items to right-hand column
{ include file="customer/mm_recent.tpl" }
<div class="spaceafternavbox"></div>
*}

{*



{literal}

<style type="text/css"></style><script language="JavaScript" src="http://www.bitsbytescomputer.com/live/web/admin/surveys.php?base_url=http://www.bitsbytescomputer.com/live"></script><script language="JavaScript" src="http://www.bitsbytescomputer.com/live/js/status_image.php?base_url=http://www.bitsbytescomputer.com/live&l=admin&x=1&deptid=1&btn=1&text=Live+Customer +Support"></script><div id="surveyDiv" style="visibility:hidden"></div>

{/literal}
</p>

*}



<font class=space>
</font>

</td>

{*jjh -- 05.17.04 -- the width setting below determines how much whitespace will appear to left of left vertical rule in main/central area *}

<td width="2px"><span class="space"><nobr></nobr></span></td>
{* <td class="space">[img]{$ImagesDir}/spacer.gif[/img]</td> *}

<td valign=top>{*<span class="space">*}


{*jjh*}

<TABLE border="0" width="100%" cellpadding="0" cellspacing="0" class="twelvepoint">
<TR>
<TD valign=top>



{include file="customer/home_main.tpl"}



{*span>*}

</TD>

<TD rowspan=2 width="2px"><span class="space"><nobr></nobr></span>
</TD>{* The width setting above determines amount of whitespace to left of right-hand nav column *}

<TD width="168px" valign="top">



{* jjh 09.30.05 *}
{if $main eq "pages"}"foo"
{else}
{ include file="customer/menu_cart.tpl" }
{/if}
{* jjh 09.30.05 *}


{ include file="customer/bb_resources.tpl" }
<div class="spaceafternavbox"></div>

{if $active_modules.Bestsellers ne "" and $config.Modules.bestsellers_menu eq "Y" }
{ include file="modules/Bestsellers/menu_bestsellers.tpl" }
{/if}

{ include file="customer/mm_recent.tpl" }
<div class="spaceafternavbox"></div>

{* jjh commented out all the rest of the right-hand column 09.24.05. *}


{* old commenting out *}
{* Auth.tpl = login panel; Menu_cart.tpl = Cart menu *}
{* AW: login box commented out (16.09.2004) *}
{* jjh -- 09.07.04 -- comment out next two lines if you want to suppress display of Authentication Box *}
{*
{if $login eq "" }
{ include file="auth.tpl" }
<div class=space style="margin-bottom:6px"></div>
{/if}
*}

{* 09.24.05
{ include file="customer/menu_cart.tpl" }
<div class="spaceafternavbox"></div>
*}

{*<div class=space style="margin-top:6px">
</div>*}
{* 09.24.05 { include file="customer/link_to_bits_bytes.tpl" }
*}

{* 09.24.05
<div class=space style="margin-top:6px">
</div>
{ include file="customer/email_friend_navbox.tpl" }
<div class=space style="margin-top:6px">
</div>
*}

{* jjh - 05.19.04 -- I commented out the requirement about being logged in so that the Newsletter box always is displayed *}

{* {if $login eq "" } *}

{* 09.24.05
{ include file="news.tpl" }
*}

{* {else} *}
{* {/if} *}
{* <div class="spaceafternavbox"></div> *}

{* 09.24.05
<div class=space style="margin-top:6px">
</div>
{ include file="customer/join_us.tpl" }
<div class=space style="margin-top:6px">
</div>

{ include file="customer/special.tpl" }

{ include file="customer/google_search.tpl" }
<div class="spaceafternavbox"></div>
*}

{*
<IFRAME name=I1 marginWidth=1 marginHeight=1 src="/store/poll/test_poll.php" frameBorder=0 width=169 scrolling=no height=220 style="background: white;"></IFRAME>
*}

</TD>
</TR>
</TABLE>

</td>

{*jjh -- 05.17.04 -- the width setting below determines how much whitespace will appear to right of right veritcal rule in main/central area *}

<td width="0px">{*<span class="space"></span>*}
</td>

</tr>
</table>


{* Bottom Area *}
{include file="customer/bottom.tpl" }

{if $smarty.get.debug eq '2' }
{php}
global $smarty;
$smarty->debug_tpl="file:debug.tpl";
{/php}
{debug}
{/if}

</body>

</html>
__________________
X-Cart v. 3.5.4 [Linux]
PHP 4.3.9
MySQL 4.1.12
Perl 5.008005
Apache/2.0.52 [CentOS]

http://www.bitsbytescomputer.com
\"Trustworthy tools for biblical studies.\"
Reply With Quote