Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

How to call a file to pop-up window?

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 04-17-2003, 12:26 AM
 
rohit rohit is offline
 

Advanced Member
  
Join Date: Apr 2003
Posts: 36
 

Default How to call a file to pop-up window?

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
Reply With Quote
  #2  
Old 04-17-2003, 02:04 PM
  B00MER's Avatar 
B00MER B00MER is offline
 

X-Guru
  
Join Date: Sep 2002
Location: Keller, TX (Cart-Lab.com)
Posts: 3,165
 

Default

Code:
{literal} <script language="Javascript" type="text/javascript"> <!-- function mypopup(mydoc) { window.open(mydoc, '_mywindow', 'HEIGHT=400,resizable=no,WIDTH=550'); } //--> </script> {/literal}

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.
__________________
Cart-Lab - 100+ Social Bookmarks for X-Cart.
Reply With Quote
  #3  
Old 04-17-2003, 09:40 PM
 
rohit rohit is offline
 

Advanced Member
  
Join Date: Apr 2003
Posts: 36
 

Default RE : How to call a file to pop-up window?

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
Reply With Quote
  #4  
Old 04-17-2003, 10:20 PM
 
funkydunk funkydunk is offline
 

X-Man
  
Join Date: Oct 2002
Location: Cambridge, UK
Posts: 2,210
 

Default

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
Reply With Quote
  #5  
Old 04-18-2003, 04:00 AM
 
rohit rohit is offline
 

Advanced Member
  
Join Date: Apr 2003
Posts: 36
 

Default RE:How to call a file to pop-up window?

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
Reply With Quote
  #6  
Old 04-18-2003, 04:01 AM
 
rohit rohit is offline
 

Advanced Member
  
Join Date: Apr 2003
Posts: 36
 

Default RE:How to call a file to pop-up window?

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
Reply With Quote
  #7  
Old 04-18-2003, 05:24 AM
 
funkydunk funkydunk is offline
 

X-Man
  
Join Date: Oct 2002
Location: Cambridge, UK
Posts: 2,210
 

Default

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
Reply With Quote
  #8  
Old 04-18-2003, 06:12 AM
 
rohit rohit is offline
 

Advanced Member
  
Join Date: Apr 2003
Posts: 36
 

Default RE:How to call a file to pop-up window?

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
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 10:11 PM.

   

 
X-Cart forums © 2001-2020