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

TPL files and their links to PHP files

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 12-11-2008, 08:21 AM
 
AMMoyer AMMoyer is offline
 

Senior Member
  
Join Date: Nov 2008
Posts: 150
 

Wink TPL files and their links to PHP files

I'm in the midst of building a new template and trying to understand how the tpl files link to the php files they are associated with. For example, I look at search.tpl in the main directory (there are 3 others and 2 of them may be the same?) and there is no less than 4 search.php files located in various places.

I guess my main question is: How does the info from the search form know where it's getting posted too? Or how can I trace the path?

If I have a new tpl file located in skin\, where should the corresponding PHP file be located?

Thanks,
Adam
__________________
Adam
X-Cart Gold 4.4.5 - Live
X-Cart Gold 4.1.11 - Retired
X-Payments 1.0.4
CDSEO Pro
EWD Hosting
Reply With Quote
  #2  
Old 12-11-2008, 09:31 AM
  Vetrivel's Avatar 
Vetrivel Vetrivel is offline
 

eXpert
  
Join Date: Apr 2008
Posts: 398
 

Default Re: TPL files and their links to PHP files

Hi,

1.
Quote:
How does the info from the search form know where it's getting posted too?
form action tag will say where to post.


2.
Quote:
how can I trace the path?

They will link the php and tpl file using the smarty variables.
EX:
PHP->
you can find the smarty variable in each php file like this
$smarty->assign("main","search");
TPL:In common templete
There will be file called common_templete.tpl in skin1/root
like this
{else if $main eq search}
{include file="tpl file name"}



Quote:
Originally Posted by AMMoyer
I'm in the midst of building a new template and trying to understand how the tpl files link to the php files they are associated with. For example, I look at search.tpl in the main directory (there are 3 others and 2 of them may be the same?) and there is no less than 4 search.php files located in various places.

I guess my main question is: How does the info from the search form know where it's getting posted too? Or how can I trace the path?

If I have a new tpl file located in skin\, where should the corresponding PHP file be located?

Thanks,
Adam
Reply With Quote
  #3  
Old 12-11-2008, 10:09 AM
 
AMMoyer AMMoyer is offline
 

Senior Member
  
Join Date: Nov 2008
Posts: 150
 

Default Re: TPL files and their links to PHP files

Thanks for the help.

So in skin1\customer\search.tpl this line of code:

<form method="post" action="search.php" name="productsearchform">

Which of the 4 search.php files does it post the data to and is that connection made in the corresponding php file?

Adam
__________________
Adam
X-Cart Gold 4.4.5 - Live
X-Cart Gold 4.1.11 - Retired
X-Payments 1.0.4
CDSEO Pro
EWD Hosting
Reply With Quote
  #4  
Old 12-11-2008, 07:23 PM
  Vetrivel's Avatar 
Vetrivel Vetrivel is offline
 

eXpert
  
Join Date: Apr 2008
Posts: 398
 

Default Re: TPL files and their links to PHP files

hi,
If you currently in customer side then this form is submited to xcart root/search.php


Quote:
Originally Posted by AMMoyer
Thanks for the help.

So in skin1\customer\search.tpl this line of code:

<form method="post" action="search.php" name="productsearchform">

Which of the 4 search.php files does it post the data to and is that connection made in the corresponding php file?

Adam
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 04:06 AM.

   

 
X-Cart forums © 2001-2020