![]() |
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. |
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! :) |
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. |
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! |
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. |
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.
|
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! |
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.
|
All times are GMT -8. The time now is 06:01 AM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.