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

How do I edit template variables

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 12-10-2007, 09:09 AM
 
RickDavisFL RickDavisFL is offline
 

Member
  
Join Date: Oct 2007
Location: Ft. Lauderdale, FL
Posts: 22
 

Default How do I edit template variables

I'm trying to figure out how to edit templates and the variables in them specifically.
Before anyone jumps at me with a manual let me say I have read it but it is not written very clearly. I do have some background with HTML but very little with CSS and no knowledge of Smarty.

Here is a specific example of my problem...

I want to edit the "copyright.tpl" template so that the text is changed from the default values to my actual company name and copyright dates.

Looking at the copyright.tpl file in the X-Cart template editor I think I understand what is going on but I do not know where the variables are defined for the gloabal scope of the site and I don't know enough about Smarty to know how to (or even if it's possible) so change them within only this template. Using the webmaster mode I can see that the copyright.tpl is a sub-object of several other .tpl's however I cannot find the variable definitions in those either.

I think that the several "$smarty.Company..." items call to the variable that follows but I am totally lost how I can find these or change them.

Any help is greatly apprecaited.
Thanks for reading.
__________________
X-Cart v4.1.9
PHP 5.2.6
MySQL 5.0.67
Apache 2.2.9

Hosted by Handsonwebhosting.com
Reply With Quote
  #2  
Old 12-10-2007, 09:40 AM
 
balinor balinor is offline
 

Veteran
  
Join Date: Oct 2003
Location: Connecticut, USA
Posts: 30,253
 

Default Re: How do I edit template variables

Welcome to the X-Cart forums! Please start by reading the following thread, which will help you get started and hopefully make your experience here a positive one:

http://forum.x-cart.com/showthread.php?t=23970

Please note that this link is not an answer to your question, but we need you to update your signature with your X-Cart version so that we can answer your question correctly. The link above will not only tell you how to do that, but give you some valuable links as well (such as the template editing guide). Thanks!
__________________
Padraic Ryan
Ryan Design Studio
Professional E-Commerce Development
Reply With Quote
  #3  
Old 12-10-2007, 09:49 AM
 
RickDavisFL RickDavisFL is offline
 

Member
  
Join Date: Oct 2007
Location: Ft. Lauderdale, FL
Posts: 22
 

Default Re: How do I edit template variables

balinor, thank you for the welcome.

I have added my x-cart version to my sig. Also, I had looked at the FAQ's and template guide on the forum but I could not find anything that related to the origins of the variables.

Right now I am thankful that I have no need to dramaticlly alter the standard X-Cart templates therefore I do not need to be fully versed in Smarty. However, I do need to make minor changes such as altering default values.

I am continuing to read through the forum as well as Smarty doc's but if you could offer any assistance I would appreciate it.

Thanks.
__________________
X-Cart v4.1.9
PHP 5.2.6
MySQL 5.0.67
Apache 2.2.9

Hosted by Handsonwebhosting.com
Reply With Quote
  #4  
Old 12-10-2007, 09:50 AM
 
balinor balinor is offline
 

Veteran
  
Join Date: Oct 2003
Location: Connecticut, USA
Posts: 30,253
 

Default Re: How do I edit template variables

Hi Rick, all of the variables are stored in the database and can be edited one of two ways:

1. Use Webmaster Mode which allows you to edit text on the fly (covered pretty well in the manual actually)

2. Go to the 'Languages' area of your admin and edit the variables directly.

Hope this helps!
__________________
Padraic Ryan
Ryan Design Studio
Professional E-Commerce Development
Reply With Quote
  #5  
Old 12-10-2007, 10:12 AM
 
RickDavisFL RickDavisFL is offline
 

Member
  
Join Date: Oct 2007
Location: Ft. Lauderdale, FL
Posts: 22
 

Default Re: How do I edit template variables

balinor,

Thank you again for your quick reply.

I must be missing something becuase I don't see any way with webmaster mode to change something like the "Your Company Name" line in the copyright.tpl section.

Using Webmaster mode the "Copyright" text highlights green but the "2005-2007 Your Company Name" is not highlighted and I cannot alter it.

Using "Languages" I can make some progress and find the " lbl_copyright" which I assume is called from the "$lng.lbl_copyright" in the copyright.tpl template. The problem is that I do not see any labels that allow me to change the other information displayed on that line of text.

I am assuming that's because these variables/labels are preceeded with the "$config." tag and therefore not in the languages section.

Any idea if anything I just said is correct?

Thanks again for your help.
__________________
X-Cart v4.1.9
PHP 5.2.6
MySQL 5.0.67
Apache 2.2.9

Hosted by Handsonwebhosting.com
Reply With Quote
  #6  
Old 12-10-2007, 11:09 AM
 
balinor balinor is offline
 

Veteran
  
Join Date: Oct 2003
Location: Connecticut, USA
Posts: 30,253
 

Default Re: How do I edit template variables

The company name variable is different, that is pulled from the data you enter in 'General Settings/Company Options'. When in doubt, use webmaster mode to determine which template the variable is in, and you will then be able to open that template to see what the variable is, or if it is a variable at all.
__________________
Padraic Ryan
Ryan Design Studio
Professional E-Commerce Development
Reply With Quote
  #7  
Old 12-10-2007, 11:59 AM
 
RickDavisFL RickDavisFL is offline
 

Member
  
Join Date: Oct 2007
Location: Ft. Lauderdale, FL
Posts: 22
 

Default Re: How do I edit template variables

Thank you for your help. I'm starting to piece it together.

I'm sure i'll continue to poke through the forums while I try to get X-Cart running.

Thanks again!
__________________
X-Cart v4.1.9
PHP 5.2.6
MySQL 5.0.67
Apache 2.2.9

Hosted by Handsonwebhosting.com
Reply With Quote
  #8  
Old 12-26-2007, 09:06 PM
 
anela2003 anela2003 is offline
 

Senior Member
  
Join Date: Nov 2007
Posts: 103
 

Default Re: How do I edit template variables

I agree, the Smarty manual is horrible for people with average intelligence such as myself. I don't even ask for Smarty help online anymore because the first thing people jump at me with is, "Why haven't you read the Smarty manual?" Well, I have and I experimented with their code snippets but none of them worked. Sadly, the help stops there. Good luck. Maybe we'll be smarter next year.
__________________
4.1.9 Gold

window valances | curtains
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 06:21 AM.

   

 
X-Cart forums © 2001-2020