X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   Graphical Buttons link back to main page (https://forum.x-cart.com/showthread.php?t=2123)

ahunte 04-01-2003 04:56 PM

Graphical Buttons link back to main page
 
I wanted to change the xcart menu buttons to my graphical buttons, so I use the information in the post
http://forum.x-cart.com/viewtopic.php?t=622 to get an xcart template to load in the home_main.tpl section of my page. I had the buttons load from newmenu.tpl, which works fine. The problem is that when you click on the menu buttons, it just loops back and shows the welcome.tpl information. You can see what I am talking about on my page http://www.presariophotos.com/xcart . I have checked my home.tpl code:
Code:

{* $Id: home.tpl,v 1.42 2002/10/22 10:27:05 olga Exp $ *}
{ config_load file="$skin_config" }
<html>
<head>
<title>{$lng.txt_site_title}
{if $main eq "catalog"}
        {if $location eq ""}  {$lng.txt_subtitle_home}
        {else}
        {strip}
        {section name=position loop=$location start=0 }
        {if %position.last% eq "true"} - {$location[position].0|escape}{/if}
        {/section}
        {/strip}
        {/if}
{elseif $main eq "product"}
        {if $product.product ne ''} - {$product.product}{/if}
{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}/{#CSSFile#}">
</head>
<body LEFTMARGIN=0 TOPMARGIN=0 RIGHTMARGIN=0 BOTTOMMARGIN=0 MARGINWIDTH=0 MARGINHEIGHT=0>
{ include file="rectangle_top.tpl" }
{ include file="head.tpl" }


<table border=0 width=85% cellpadding=0 cellspacing=0 align="center">
<tr>
<!-- Taking out to test
<td class=VertMenuBox width=6></td>
-->

<td class=VertMenuBox width=119 valign=top>
{ include file="newmenu.tpl" }
<!-- Taking out catagories (events)
{ include file="customer/categories.tpl" }
-->
<!-- {if $active_modules.Bestsellers ne "" and $config.Modules.bestsellers_menu eq "Y"}
{ include file="modules/Bestsellers/menu_bestsellers.tpl" }
{/if} -->
<!-- Moving Gift Certificates & help to the other column
{if $active_modules.Gift_Certificates ne ""}


{ include file="modules/Gift_Certificates/gc_menu.tpl" }
{/if}


End Move -->
{ include file="help.tpl" }
</td>
 
<td width=20></td>

<td valign=top>



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




</td>
<td width=20></td>

<td width=120 valign=top>
{ include file="customer/menu_cart.tpl" }
{if $login eq "" }
{ include file="auth.tpl" }
{else}
{ include file="authbox.tpl" }
{/if}
{if $active_modules.Gift_Certificates ne ""}


{ include file="modules/Gift_Certificates/gc_menu.tpl" }
{/if}


{ include file="news.tpl" }


{ include file="poweredby.tpl" }
</td>
</tr>
<tr>
<td class=VertMenuBox></td>
<td>&nbsp</td>
<td>{ include file="copyright.tpl" }</td>
<td></td>
<td></td>
</tr>
</table>
{ include file="rectangle_bottom.tpl" }
</body>
</html>


And my home_tpl code:
Code:

{if $smarty.get.mode eq "subscribed"}
{include file="main/subscribe_confirmation.tpl"}

{elseif $main eq "about_us"}
{include file="main/about_us.tpl"}

 
{elseif $main eq "events"}
{include file="events.tpl"}
 

{elseif $smarty.get.mode eq "unsubscribed"}
{include file="main/unsubscribe_confirmation.tpl"}

{elseif $main eq "search"}
{include file="customer/main/search_result.tpl"}

{elseif $main eq "advanced_search"}
{include file="customer/main/advanced_search.tpl"}

{elseif $main eq "cart"}
{include file="customer/main/cart.tpl"}

{elseif $main eq "wishlist"}
{if $active_modules.Wishlist ne ""}
{include file="modules/Wishlist/wishlist.tpl"}
{/if}

{elseif $main eq "anonymous_checkout"}
{include file="customer/main/anonymous_checkout.tpl"}

{elseif $main eq "order_message"}
{include file="customer/main/order_message.tpl"}

{elseif $main eq "checkout"}
{include file="customer/main/checkout.tpl"}

{elseif $main eq "product"}
{include file="customer/main/product.tpl" product=$product}

{elseif $main eq "giftcert"}
{include file="modules/Gift_Certificates/giftcert.tpl"}

{elseif $main eq "subscriptions"}
{include file="modules/Subscriptions/subscriptions.tpl"}


{elseif $main eq "catalog" and $current_category.category eq ""}
{include file="customer/main/welcome.tpl" f_products=$f_products}

{elseif $main eq "catalog"}
{include file="customer/main/subcategories.tpl"}




{else}
{include file="common_templates.tpl"}
{/if}


And finally my newmenu.tpl code:

Code:

{* $Id: newmenu.tpl,v 1.4 2002/08/20 13:16:29 zorg Exp $ *}
<center>
[img]{$ImagesDir}/register.gif[/img]

<a href="home.php?mode=events">[img]{$ImagesDir}/viewpics.gif[/img]

[img]{$ImagesDir}/aboutphoto.gif[/img]

[img]{$ImagesDir}/presarioproductions.gif[/img]

[img]{$ImagesDir}/contactus.gif[/img]
</center>


I am lost to what i am doing wrong, HELP PLEASE!!!!!

ahunte 04-01-2003 04:59 PM

Correction
 
when I said home_tpl I meant home_main.tpl

HELP!

Thanks!

ahunte 04-04-2003 06:50 PM

I got it working, thanks to funkydunk. It seems like to link to the categories.tpl to make it load in the home.tpl area, you must change some of the smarty code. Below is the solution he gave me for future reference...

From: funkydunk
To: ahunte
Posted: Fri Apr 04, 2003 6:07 pm
Subject: Re: HELP please!
okay...here goes.

first create a mirror copy of customer/home.php calling it catlist.php

then amend the line that is :
$smarty->assign("main","catalog");

to
$smarty->assign("main","catlist");

then change the link to catlist.php

job done

John7 04-05-2003 10:00 AM

I have a question.
 
I have a question.

Why not just create the categories that you need.

Past the image buttons you need into customer/home.tpl

Right click on the dynamic links and copy shortcut.

Right click on the image buttons and hyperlink then with the link you copied. Do that for each one.

Then comment out the code that displays the categories in the side menu in the home.tpl?

Seems easier than creating more templates just to display buttons.

What do you think?

John7


All times are GMT -8. The time now is 01:54 PM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.