| ||||||||||
![]() |
Shopping cart software Solutions for online shops and malls | |||||||||
![]() |
![]() |
|
X-Cart Home | ![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
smarty template testing | |||
![]() |
|
|
Thread Tools | Search this Thread |
#1
|
|||||||
|
|||||||
![]() Ok,
Newbie question but... I am currently reading throught he smarty templates instruction book and have decided to test a couple of things out. The first excercise is to see if smarty is working properly. so I entered the following into the /customer/main/welcome.tpl: $smarty->assign('name','dion'); <table border="0" cellpadding="2" cellspacing="0"> <tr> <td> Hello, {$name}! </td> </td> </table> Like it says in the book.. then it just displays the assign line and the name line without a name.. what am i doing wrong? cheers.
__________________
Dion Jones, Web Dev, Db admin www.smallislandtrader.com X-cart Ver. 3.5.4 o/s Windows2000 |
|||||||
#2
|
|||||||||
|
|||||||||
![]() try wrap your first tag in {}
__________________
Looking for a reliable X-cart host ? You wont go wrong with either of these. ![]() ![]() |
|||||||||
#3
|
|||||||
|
|||||||
![]() tried that
it comes up with the error: Fatal error: Smarty: [in customer/main/welcome.tpl line 7]: syntax error: unrecognized tag: $smarty->assign('name','dion'); (Smarty_Compiler.class.php, l in /var/www/html/store/Smarty-2.5.0/Smarty_Compiler.class.php on line 1832
__________________
Dion Jones, Web Dev, Db admin www.smallislandtrader.com X-cart Ver. 3.5.4 o/s Windows2000 |
|||||||
#4
|
|||||||||
|
|||||||||
![]() i take it you know about http://smarty.php.net
__________________
Looking for a reliable X-cart host ? You wont go wrong with either of these. ![]() ![]() |
|||||||||
#5
|
|||||||
|
|||||||
![]() yep. i've looked on there.. perhaps it's time to post a question on there...
I just thought someone might have tried it on here...
__________________
Dion Jones, Web Dev, Db admin www.smallislandtrader.com X-cart Ver. 3.5.4 o/s Windows2000 |
|||||||
#6
|
|||||||
|
|||||||
![]() aparently,
(I don't know why this didn't occur to me before) but the $smarty->assign('name','dion'); is PHP. Where could i insert the PHP line? does the home.php page exist as i can't find it anywhere?
__________________
Dion Jones, Web Dev, Db admin www.smallislandtrader.com X-cart Ver. 3.5.4 o/s Windows2000 |
|||||||
#7
|
|||||||||
|
|||||||||
![]() you have to imagine that the browser calls a php file which then assigns the smarty variables and then displays them in the smarty templates.
best way to suss it out is to look at one of the simple php pages of xcart and follow the logic through
__________________
Looking for a reliable X-cart host ? You wont go wrong with either of these. ![]() ![]() |
|||||||||
#8
|
|||||||
|
|||||||
![]() got it working.. cheers.
just had to find that pesky home.php file. ![]()
__________________
Dion Jones, Web Dev, Db admin www.smallislandtrader.com X-cart Ver. 3.5.4 o/s Windows2000 |
|||||||
![]() |
|
Thread Tools | Search this Thread |
|
|
|
|||
X-Cart forums © 2001-2020
|