| ||||||||||
![]() |
Shopping cart software Solutions for online shops and malls | |||||||||
![]() |
![]() |
|
X-Cart Home | ![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
Trouble adding Header to Head_Customer.tpl | |||
![]() |
|
|
Thread Tools | Search this Thread |
#1
|
|||||||
|
|||||||
![]() I have been trying to add a header I built in dreamweaver.
I saved the file as .php and included it in a table in head_customer.tpl as { include file="header.php" } But I keep getting this error: Warning: Smarty error: unable to read resource: "header.php" in /home/redstar1/public_html/Smarty-2.6.9/Smarty.class.php on line 1088 Any ideas? here is the head_customer.tpl code <table width="780" border="0" cellspacing="0" cellpadding="0"> <tr> <td>{ include file="header.php" }</td> </tr> </table> <TABLE border="0" cellpadding="0" cellspacing="0" width="100%"> <TR> <TD width="150" class="HeadLine" valign="top">{ include file="customer/search.tpl" } </TD> <TD width="20">[img]{$ImagesDir}/spacer.gif[/img]</TD> <TD width="610" valign="top">{if $login eq "" }{include file="customer/auth.tpl"}{else}{ include file="customer/authbox.tpl" }{/if} <TABLE border="0" cellpadding="0" cellspacing="0" width="100%"> <TR> <TD height="16">{if $main ne "catalog" or $current_category.category ne ""}{include file="location.tpl"}{/if}</TD> <TD align="right" width="107"> <TABLE cellspacing="0" cellpadding="0" border="0" height="16"> <TR> <TD>[img]{$ImagesDir}/spacer.gif[/img]</TD> {if (($main eq 'catalog' && $cat ne '') || $main eq 'product') && $config.Appearance.enabled_printable_version eq 'Y'} <TD width="100%" valign="middle" align="right">{include file="printable.tpl"}</TD> {/if} </TR> </TABLE> </TD> </TR> </TABLE> </TD> </TR> </TABLE>
__________________
4.0.12 x-cart |
|||||||
#2
|
|||||||
|
|||||||
![]() You should save the file as a .tpl file, not a php file.
__________________
Padraic Ryan Ryan Design Studio Professional E-Commerce Development |
|||||||
#3
|
|||||||
|
|||||||
![]() i tried that too and it did ot work... same error
__________________
4.0.12 x-cart |
|||||||
#4
|
|||||||
|
|||||||
![]() could it be a problem with the header code?
__________________
4.0.12 x-cart |
|||||||
#5
|
|||||||
|
|||||||
![]() Post the code and we'll see.
__________________
Padraic Ryan Ryan Design Studio Professional E-Commerce Development |
|||||||
#6
|
|||||||
|
|||||||
![]() <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <title>Untitled Document</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <script language="JavaScript" type="text/JavaScript"> <!-- function MM_reloadPage(init) { //reloads the window if Nav4 resized if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) { document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }} else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload(); } MM_reloadPage(true); function MM_swapImgRestore() { //v3.0 var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc; } function MM_preloadImages() { //v3.0 var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array(); var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++) if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}} } function MM_findObj(n, d) { //v4.01 var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) { d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);} if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n]; for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); if(!x && d.getElementById) x=d.getElementById(n); return x; } function MM_swapImage() { //v3.0 var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3) if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];} } //--> </script> </head> <body onLoad="MM_preloadImages('files/my_account_on.jpg','files/register_on.jpg','files/shopping_bag_on.jpg','files/checkout_on.jpg','files/home_on.jpg','files/shop_sd_on.jpg','files/shop_slv_on.jpg','files/locator_on.jpg','files/our_story_on.jpg','files/media_on.jpg','files/contact_us_on.jpg')"> <table width="780" height="35" border="0" cellspacing="0" cellpadding="0"> <tr> <td>[img]files/header_pc1.jpg[/img]</td> <td>[img]files/my_account_off.jpg[/img]</td> <td>[img]files/register_off.jpg[/img]</td> <td>[img]files/shopping_bag_off.jpg[/img]</td> <td>[img]files/checkout_off.jpg[/img]</td> </tr> </table> <table width="780" height="170" border="0" cellspacing="0" cellpadding="0"> <tr> <td colspan="7">[img]files/header_pc2.jpg[/img]</td> </tr> <tr> <td width="65" height="31">[img]files/home_off.jpg[/img]</td> <td width="141" height="31">[img]files/shop_sd_off.jpg[/img]</td> <td width="111" height="31">[img]files/shop_slv_off.jpg[/img]</td> <td width="66" height="31">[img]files/locator_off.jpg[/img]</td> <td width="73" height="31">[img]files/our_story_off.jpg[/img]</td> <td width="51" height="31">[img]files/media_off.jpg[/img]</td> <td width="273" height="31">[img]files/contact_us_off.jpg[/img]</td> </tr> </table> </body> </html>
__________________
4.0.12 x-cart |
|||||||
#7
|
|||||||
|
|||||||
![]() that is the header coding
__________________
4.0.12 x-cart |
|||||||
#8
|
|||||||
|
|||||||
![]() This is the head_customer.tpl coding:
{*<TABLE border="0" cellpadding="0" cellspacing="0" width="780" class="TopLine"> <TR> <TD width="780">[img]{$ImagesDir}/spacer.gif[/img]</TD> </TR> </TABLE>*} <TABLE border="0" cellpadding="0" cellspacing="0" width="780"> <TR class="TopMenu"> {*<TD width="780"> {if $config.Company.company_phone}{$lng.lbl_phone_1_ti tle}: {$config.Company.company_phone}{/if}{if $config.Company.company_phone_2}{$lng.lbl_phone_2_ title}: {$config.Company.company_phone_2}{/if} </TD>*} <TD width="181" align="right" valign="center"> </TD> </TR> <TR> <TD align="center" valign="center">[img]{$ImagesDir}/customer_images/company_logo.gif[/img]</TD> <TD align="right" class="HeadText"> {if $all_languages_cnt gt 1} <TABLE border="0" cellpadding="0" cellspacing="0"> <FORM action="home.php" method="GET" name="sl_form"> <INPUT type="hidden" name="redirect" value="{$smarty.server.PHP_SELF}?{$smarty.server.Q UERY_STRING}"> <TR> <TD><FONT class="TopMenuSmallText">{$lng.lbl_select_language }:</FONT> <SELECT name="sl" onChange="javascript: document.sl_form.submit()"> {section name=ai loop=$all_languages} <OPTION value="{$all_languages[ai].code}"{if $store_language eq $all_languages[ai].code} selected{/if}>{$all_languages[ai].language}</OPTION> {/section} </SELECT> </TD></TR> </FORM> </TABLE> {else} {/if} </TR> <TR> <TD colspan="2" align="left" valign="center">{section name=sb loop=$speed_bar} {if $speed_bar[sb].active eq "Y"} [img]{$ImagesDir}/customer_images/arrow.gif[/img]{$speed_bar[sb].title} {if $speed_bar[sb].link eq "cart.php"}{else}{/if} {/if} {/section}</TD> </TR> </TABLE> <TABLE border="0" cellpadding="0" cellspacing="0" width="100%"> <TR> <TD width="150" class="HeadLine" valign="top">{ include file="customer/search.tpl" } </TD> <TD width="20">[img]{$ImagesDir}/spacer.gif[/img]</TD> <TD width="610" valign="top">{if $login eq "" }{include file="customer/auth.tpl"}{else}{ include file="customer/authbox.tpl" }{/if} <TABLE border="0" cellpadding="0" cellspacing="0" width="100%"> <TR> <TD height="16">{if $main ne "catalog" or $current_category.category ne ""}{include file="location.tpl"}{/if}</TD> <TD align="right" width="107"> <TABLE cellspacing="0" cellpadding="0" border="0" height="16"> <TR> <TD>[img]{$ImagesDir}/spacer.gif[/img]</TD> {if (($main eq 'catalog' && $cat ne '') || $main eq 'product') && $config.Appearance.enabled_printable_version eq 'Y'} <TD width="100%" valign="middle" align="right">{include file="printable.tpl"}</TD> {/if} </TR> </TABLE> </TD> </TR> </TABLE> </TD> </TR> </TABLE>
__________________
4.0.12 x-cart |
|||||||
#9
|
|||||||
|
|||||||
![]() Ok, there is your poblem....you can't have head, body, html, etc tags in there as they are all already called in customer/home.tpl. If you want to include a javascript, you need to include it in the <head> tags of customer/home.tpl.
__________________
Padraic Ryan Ryan Design Studio Professional E-Commerce Development |
|||||||
#10
|
|||||||
|
|||||||
![]() Worked great! Thank you!
__________________
4.0.12 x-cart |
|||||||
|
|||
X-Cart forums © 2001-2020
|