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

Smarty - who what when where & why?

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 07-08-2004, 08:29 AM
 
bkluth bkluth is offline
 

Senior Member
  
Join Date: May 2003
Posts: 119
 

Default Smarty - who what when where & why?

Ok...I have 2 xcart sites up and running. I am installing a 3rd for a new customer. They want it moderately customized. So I start looking at the templates and trying to figure out how to move stuff around. Then I see Smarty. I read about it, look over the websites that give tutorials, try to find some information. I am not a programmer, but I am not stupid. Or am I? I find myself still wanting answers to some very basic questions about Smarty. Maybe there is a big "link" that I'm missing or something, but I can't figure this Smarty out. Ok, stupid or not, here they are:

1. Are there any screen shots of what using Smarty looks like?
2. If there is a Smarty folder in the xcart directory, does that mean that Smarty is already installed on the server and is usable?
3. How do I start Smarty and start using it?
4. Being fairly new with php and templates, should I even TRY Smarty?
5. Will I mess anything up if I try it?
6. Will Smarty help me modify the an xcart site and move the components around?
7. What other information would someone new to Smarty need to get started, without royally screwing the xcart code up.

Yes I HAVE read most of the info I can find on Smarty. It still doesn't make sense to me. I am lost. Sorry for asking what are probably stupid questions.

Thanks
__________________
www.dramaticvisions.com
Reply With Quote
  #2  
Old 07-08-2004, 08:40 AM
  BCSE's Avatar 
BCSE BCSE is offline
 

X-Guru
  
Join Date: Apr 2003
Location: Ohio - bcsengineering.com
Posts: 3,063
 

Default

X-cart USES Smarty. That's what the templates are comprised of, Smarty templates. So basically you have a huge smarty example infront of you with everything in skin1 folder and subfolders.

I found it pretty confusing at first, but once you dive into it, things become clearer.

I've found this site invaluable:
http://smarty.php.net/docs.php

HTH!

Carrie
__________________
Custom Development, Custom Coding and Pre-built modules for X-cart since 2002!

We support X-cart versions 3.x through 5.x!

Home of the famous Authorize.net DPM & CIM Modules, Reward Points Module, Point of Sale module, Speed Booster modules and more!


Over 200 X-cart Mods available & Thousands of Customizations Since 2002 - bcsengineering.com

Please E-Mail us for questions/support!
Reply With Quote
  #3  
Old 07-08-2004, 08:56 AM
  Jon's Avatar 
Jon Jon is offline
 

X-Guru
  
Join Date: Oct 2002
Location: Vancouver, Canada
Posts: 4,200
 

Default

Basically there are 3 layers.

Database
PHP
Smarty

Smarty allows a pretty basic front end, and still allows coding in it - the coding needs to be smarty coding of course.

You can use PHP to collect information and interact with your database. The variables are then assigned to smarty from the php file, and a smarty display template is called, and then assigned variables can be used in your smarty templates which are located in the skin1 directory.
Reply With Quote
  #4  
Old 07-08-2004, 09:12 AM
 
bkluth bkluth is offline
 

Senior Member
  
Join Date: May 2003
Posts: 119
 

Default

So when I am looking at the xcart templates...that is what Smarty is?

Hmmm...maybe the README file that comes with Xcart should say that... because seeing that notice about Smarty made me think I had to install a whole new program. Glad I don't!

So I was actually on the right track of editing the xcart templates BEFORE I started looking into Smarty.

Ok...thank you so much for telling me that. I thought I was really losing my grip on xcart!

Thank you!!!!!!!!
__________________
www.dramaticvisions.com
Reply With Quote
  #5  
Old 07-08-2004, 09:19 AM
  BCSE's Avatar 
BCSE BCSE is offline
 

X-Guru
  
Join Date: Apr 2003
Location: Ohio - bcsengineering.com
Posts: 3,063
 

Default

Quote:
So when I am looking at the xcart templates...that is what Smarty is?

Yep. All the stuff in the curly braces {} are smarty "things" in normal HTML code.

Carrie
__________________
Custom Development, Custom Coding and Pre-built modules for X-cart since 2002!

We support X-cart versions 3.x through 5.x!

Home of the famous Authorize.net DPM & CIM Modules, Reward Points Module, Point of Sale module, Speed Booster modules and more!


Over 200 X-cart Mods available & Thousands of Customizations Since 2002 - bcsengineering.com

Please E-Mail us for questions/support!
Reply With Quote
  #6  
Old 07-08-2004, 09:34 AM
  Jon's Avatar 
Jon Jon is offline
 

X-Guru
  
Join Date: Oct 2002
Location: Vancouver, Canada
Posts: 4,200
 

Default

Just remember, if you don't assign a variable to smarty from php, you won't be able to use it in the smarty brackets. Oh the frustration that has caused me on occasion
Reply With Quote
  #7  
Old 07-16-2004, 11:02 AM
 
Yang Xu Yang Xu is offline
 

Senior Member
  
Join Date: May 2004
Location: Portland, Oregon
Posts: 175
 

Default

Quote:
Basically there are 3 layers.

Database
PHP
Smarty

Smarty allows a pretty basic front end, and still allows coding in it - the coding needs to be smarty coding of course.

There are many languages to create web site, like java, php, etc. Basicly when using PHP, the PHP is used for logic parts and connected to database. We still need HTML for page look or layout. Before Smarty, people mix the PHP and HTML in one page. It is very hard part to seperate the work for programmer to design logic and web designer to design page look.

Using Smarty, the logic (PHP) and look (HTML) in seperate pages and using Smarty to link them. So whem web designer modify the page look, he don't need to tell programmer. In the other side, when the programmer want to change the page logic, he don't need to change the page look. All connected by Smarty.

For example in XCart, if you buy a template from three party. You just need put the files for "look" in the directory and it works! You don't need to touch other parts at all. They are seperate. Very neat and clean!

Do I make it more confused?

Good luck!
__________________
Carts n Tools.com
- New Root HTML Generator
- Templates | Add-Ons | Services
- XCart 4.0.x
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 05:37 PM.

   

 
X-Cart forums © 2001-2020