X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   $smarty->assign("main", "home"); how it goes to home.tpl (https://forum.x-cart.com/showthread.php?t=30823)

asa 04-30-2007 07:13 AM

$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?

geckoday 04-30-2007 07:47 AM

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.

asa 04-30-2007 11:15 AM

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

geckoday 04-30-2007 12:22 PM

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.

asa 05-01-2007 06:06 AM

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


All times are GMT -8. The time now is 01:29 AM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.