| ||||||||||
![]() |
Shopping cart software Solutions for online shops and malls | |||||||||
![]() |
![]() |
|
X-Cart Home | ![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
How to call a file to pop-up window? | |||
![]() |
|
|
Thread Tools | Search this Thread |
#1
|
|||||||
|
|||||||
![]() Hi there,
I have included a javascript for pop-up window in the home.tpl file and a test link "Click". The pop-up window is opening up when someone clicks on link "Click" but the problem is that the file i am trying to call is not appearing in the pop-up window. I show you what i did with the link "Click" : I tried it two ways : 1. <font size=2> Click</font> 2. <font size=2> Click</font> tatextfile.tpl is inside customer folder. The is not showing in the pop-up either of the ways. Tell me how to do it. Thanks in advance
__________________
Rohit Sharma |
|||||||
#2
|
|||||||||
|
|||||||||
![]() Code:
A function I use for poping up windows just call it like so: Code:
Hope that helps, NOTE: my {literal} tags around my javascript so Smarty doesn't try to interrupt my javascript as smarty code. ![]() |
|||||||||
#3
|
|||||||
|
|||||||
![]() Hello Boomer,
Sorry! that didn't work. I did exactly as you said. I replaced my script to yours. I created a file sample.html in customer folder. No results. Check it out at http://www.templatearena.com/xcart/customer . Look for link "Click" at the top of right vertical bar above cart heading. Heres the code in customer/home.tpl . I have bolded the required lines. ---------------------------------------------------------------------------------- {* $Id: home.tpl,v 1.42 2002/10/22 10:27:05 olga Exp $ *} { config_load file="$skin_config" } <html> <head> <title>----Welcome to TemplateArena------------------------------------------------------------------------ </title> {literal} <script language="Javascript" type="text/javascript"> <!-- function mypopup(mydoc) { window.open(mydoc, '_mywindow', 'HEIGHT=400,resizable=no,WIDTH=550'); } //--> </script> {/literal} { 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="customer/head.tpl" } { include file="customer/search1.tpl" } <table width="747" border="0" cellspacing="0" cellpadding="0" align="center"> <tr> <td width="150" height="18" valign="top" bgcolor="#8DAED2">{ include file="customer/categories.tpl" } { include file="help.tpl" }</td> <td width="447" height="36" rowspan="2" valign="top"> { include file="customer/home_main.tpl" }</td> <td width="150" valign="top" bgcolor="#8DAED2"> <font size=2> Click</font>{ include file="customer/menu_cart.tpl" } {if $login eq "" } { include file="auth.tpl" } {else} { include file="authbox.tpl" } {/if} { include file="news.tpl" } </td> </tr> <tr> {if $active_modules.Bestsellers ne "" and $config.Modules.bestsellers_menu eq "Y"} <td width="150" height="18>{ include file="modules/Bestsellers/menu_bestsellers.tpl" }</td>{/if} <td width="150"></td> </tr> </table> </body> </html> -------------------------------------------------------------------- Looking forward for the solution. ![]() Best Regards
__________________
Rohit Sharma |
|||||||
#4
|
|||||||
|
|||||||
![]() try:
http://forum.x-cart.com/viewtopic.php?t=2755&highlight= not the definitive answer but tells you how to do it. Basically, you should call the php file not the .tpl
__________________
ex x-cart guru ![]() |
|||||||
#5
|
|||||||
|
|||||||
![]() I have done this way. I think its as you directed me:
1. Created a php file in customer/sample1.php CODE : sample1.php $smarty = new Smarty; $smarty->assign('Contacts', array('555-222-9876', 'zaphod@slartibartfast.com', array('555-444-3333', '555-111-1234'))); $smarty->display('sample1.tpl'); 2. Created a tpl file in customer/sample1.tpl CODE : sample1.tpl {$Contacts[0]} {$Contacts[1]} {* you can print arrays of arrays as well *} {$Contacts[2][0]} {$Contacts[2][1]} 3. In home.tpl i called sample1.php through pop-up code : <font size=2> Click</font> and the result see http://www.templatearena.com/xcart/customer Donot forget to click on the link "Click" (towards right) Can you give me a working example please! I am just a newbie. It would be better for me if you give me a step by step small instruction to build a popup in which a file is called in the popup. I would be ever greatful to you. thanks. hope for the best. bye
__________________
Rohit Sharma |
|||||||
#6
|
|||||||
|
|||||||
![]() I have done this way. I think its as you directed me:
1. Created a php file in customer/sample1.php CODE : sample1.php $smarty = new Smarty; $smarty->assign('Contacts', array('555-222-9876', 'zaphod@slartibartfast.com', array('555-444-3333', '555-111-1234'))); $smarty->display('sample1.tpl'); 2. Created a tpl file in customer/sample1.tpl CODE : sample1.tpl {$Contacts[0]} {$Contacts[1]} {* you can print arrays of arrays as well *} {$Contacts[2][0]} {$Contacts[2][1]} 3. In home.tpl i called sample1.php through pop-up code : <font size=2> Click</font> and the result see http://www.templatearena.com/xcart/customer Donot forget to click on the link "Click" (towards right) Can you give me a working example please! I am just a newbie. It would be better for me if you give me a step by step small instruction to build a popup in which a file is called in the popup. I would be ever greatful to you. thanks. hope for the best. bye
__________________
Rohit Sharma |
|||||||
#7
|
|||||||
|
|||||||
![]() can you post the full code from your popup php script cos it's missing the <? and ?> php tags at the moment?
__________________
ex x-cart guru ![]() |
|||||||
#8
|
|||||||
|
|||||||
![]() Oh! is that so. But this is all i have. I had copied it from an example given in the manual supplied by x-cart for understanding smarty script.
I am just a beginner!! Please, you tell me how to do it by taking the code sent by me for test. Tell me also if i were to include tables to add text and images would it be possible in php??
__________________
Rohit Sharma |
|||||||
|
|||
X-Cart forums © 2001-2020
|