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

$smarty->assign("main", "home"); how it goes to home.tpl

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 04-30-2007, 07:13 AM
 
asa asa is offline
 

Member
  
Join Date: Apr 2007
Location: UK
Posts: 20
 

Default $smarty->assign("main", "home"); how it goes to home.tpl

on $smarty->assign("main", "home");

this will retrive the home.tpl. On which file does it do it, so that it should bring home.tpl.

I wanted to do the same let is say register1 which should bring register1.tpl i that new y created . but it give page not found.

any hint will be appreciated

also when it says ("admin/home.tpl", $smarty); what the $smarty object does here does it have any value?
__________________
XCart Ver. 4.0.14-gold_upgrade
Reply With Quote
  #2  
Old 04-30-2007, 07:47 AM
 
geckoday geckoday is offline
 

X-Wizard
  
Join Date: Aug 2005
Posts: 1,073
 

Default Re: $smarty->assign("main", "home"); how it goes to home.tpl

func_display("customer/home.tpl",$smarty); says to display skin1/customer/home.tpl

skin1/customer/home.tpl will include skin1/customer/home_main.tpl which looks at the value of "main" to decide which other template to include. "main" is set by the $smarty->assign("main", "home"); statement.

The $smarty object is the smarty templating engine - its what makes he pages display so you must have it.

So to display the page you would put these statements in your php:

$smarty->assign("main", "register1");
func_display("customer/home.tpl",$smarty);

Then tweak skin1/customer/home_main.tpl to check for "main" equal to register1 and include your new template.
__________________
Manuka Bay Company
X-Cart Version 4.0.19 [Linux]

UGG Boots and other fine sheepskin products
http://www.snowriver.com
Reply With Quote
  #3  
Old 04-30-2007, 11:15 AM
 
asa asa is offline
 

Member
  
Join Date: Apr 2007
Location: UK
Posts: 20
 

Default Re: $smarty->assign("main", "home"); how it goes to home.tpl

thanks geckoday for your quick respons,

In my admin/home.php I have func_display("admin/home.tpl", $smarty); however on the skin1/admin/ there is no home.tpl file. I just cant understand where is this admin home.tpl file?

Also as you metioned that skin1/customer/home_main.tpl : is there any skin1/admin/???_main.tpl or any file where I can twick the "main" value for admin area?.

thanks
__________________
XCart Ver. 4.0.14-gold_upgrade
Reply With Quote
  #4  
Old 04-30-2007, 12:22 PM
 
geckoday geckoday is offline
 

X-Wizard
  
Join Date: Aug 2005
Posts: 1,073
 

Default Re: $smarty->assign("main", "home"); how it goes to home.tpl

Sorry, I missed the admin part of it. In admin things get a little weird. For X-Cart Gold it works like this, not sure about X-Cart Pro. To display the page the statements are:

@include $xcart_dir."/modules/gold_display.php";
func_display("admin/home.tpl", $smarty);

That include is what makes things weird. If the user is setup as fulfillment staff it displays skin1/fulfilment/home.tpl otherwise it displays skin1/single/home.tpl

Those are the two files you need to tweak to check main for your page name and include it.
__________________
Manuka Bay Company
X-Cart Version 4.0.19 [Linux]

UGG Boots and other fine sheepskin products
http://www.snowriver.com
Reply With Quote
  #5  
Old 05-01-2007, 06:06 AM
 
asa asa is offline
 

Member
  
Join Date: Apr 2007
Location: UK
Posts: 20
 

Default Re: $smarty->assign("main", "home"); how it goes to home.tpl

thanks geckoday
__________________
XCart Ver. 4.0.14-gold_upgrade
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 01:29 PM.

   

 
X-Cart forums © 2001-2020