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

Smarty Template Error

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 10-09-2002, 12:05 PM
 
ethistle ethistle is offline
 

Member
  
Join Date: Sep 2002
Location: Florida, USA
Posts: 11
 

Default Smarty Template Error

Hello,

I was adding a couple of files the xcart guys gave me for doubling up the product on the pages (which look great) however I was adding it to another site I am doing and got the error
Warning: Smarty error: unable to read template resource: "currency.tpl" in /home/virtual/camerons/home/httpd/html/store/Smarty-2.0/Smarty.class.php on line 470

My isp coudn't delete the folders under templates directory. Is this generally the problem? or do I need to do something else.

The site was working fine until this!! I have used the same couple of files on four sites now without any problems.

Thank you

Eliz
http://www.emccdesign.com
__________________
Live long and wrinkle!
Reply With Quote
  #2  
Old 10-09-2002, 03:12 PM
 
syddos syddos is offline
 

eXpert
  
Join Date: Sep 2002
Location: London, England, UK
Posts: 259
 

Default

Hi Eliz,

Quote:
Originally Posted by ethistle
Warning: Smarty error: unable to read template resource: "currency.tpl" in /home/virtual/camerons/home/httpd/html/store/Smarty-2.0/Smarty.class.php on line 470

Sounds like it could be due to the file permissions on the new file you uploaded. Check and change is required using 'chmod 777 file_name.tpl'

Quote:
Originally Posted by ethistle
My isp coudn't delete the folders under templates directory. Is this generally the problem? or do I need to do something else.

To delete or clear the "templates_c" folder run "www.your_website/xcart/cleanup.php" form your Browser once the compiled templates have been removed by "cleanup.php", you will be able to delete the empty folder. (you may have to change file permissons first 'chmod 777 templatec_c')

If you have already sent the "templates_c" folder to the trash can, you will have to "restore" it, then use "cleanup.php" to empty it.

Note: These are only compiled templates, they are not the "original" templates. New Compiled templates will be created on first access, and stored in the "templates_c" folder.

If you are changing a lot of files, it's good pratice to run "cleanup.php" to remove the old compiled files.
__________________
Syddos

Nothing is impossible, We just don't know how to do it ........Yet!

Xcart 4.1.X PRO (Testing Platform: winXP Pro)
Perl 5.8.7 (win32)
WINAMP 1.6.3 (win32 server package. Includes the following)
- phpMyAdmin v2.8.03
- MySql 5.0.21
- Apache 2.0.55 (win32)
- php 5.1.4
- SQLitemanager 1.2.0
Reply With Quote
  #3  
Old 10-09-2002, 03:48 PM
 
matt matt is offline
 

Advanced Member
  
Join Date: Oct 2002
Location: LA, Calif.
Posts: 47
 

Default

By newly "compiled templates" do you mean newly created, modified or both?

Also when you say it clears the old templates, which ones do you mean?


Thanks

Matt
Reply With Quote
  #4  
Old 10-12-2002, 01:59 PM
 
syddos syddos is offline
 

eXpert
  
Join Date: Sep 2002
Location: London, England, UK
Posts: 259
 

Default

Quote:
Originally Posted by Matt
By newly "compiled templates" do you mean newly created, modified or both?

Also when you say it clears the old templates, which ones do you mean?

Hi Matt,

I think I need to explain how XCart works.
[list=1][*]Lets start with the "customer/home.tpl". This template file is ran every time a user clicks on Any Menu Link. "customer/home.tpl" contains the Layout <HTML>, <HEAD>, <TITLE>, <BODY> tags, and the main <TABLE> for the page layout (LEFT column, CENTER column, RIGHT column) <TR><TD> tags.

All the other templates (.tpl) files e.g. "main/register.tpl", "news.tpl", "help.tpl" etc are included in "customer/home.tpl" (v3.1.x) in "customer/main_home.tpl" (v3.2.x )[*] When a customer connects to xcart, Smarty gets All the template files, required to produce that page.
  1. Smarty then complies COPIES of all the templates required to produce that page, and stores the complied templates in the template_c directory for future use.
  2. Smarty also monitors changes to the "skin1/any_file_name.tpl files, and will re-compile the changed .tpl file, and store it in the template_c directory.
  3. Smarty can deliver the "Complied files" much faster to the users computer. Complied files also means the users Browser has less work to do, so the pages loads much faster on their monitor.
[*]If you are making a lot of changes to template files, it's good pratice to run cleanup.php from your browser (www.your_website.com/xcart/cleanup.php), to remove the existing compiled templates, and force Smarty to compile a new fresh set of template files. This makes sure that only the most recent .tpl files are in the "templates_c" directory. [*]If a template file has an HTML error in the code, smarty will still compile the template, if it has a php error, smarty will NOT compile the template, and will produce one or more error messages on your monitor. [*]If you are upgrading, and want to delete the old xcart installation, you MUST run "cleanup.php" FIRST to delete the compiled files in the "templates_c" directory. These files are HIDDEN and LOCKED by Smarty, to protect them from being written to or deleted, by any other person or program, other than Smarty.

I know some people in this forum have had problems, when deleting xcart from their servers, they always find that the template_c directory remains after all the other files have been deleted (depending on what file permissions you have changed). Some have found that their Hosting Site support staff cannot delete the template_c directory.

If this has happened to you, and you need the space, and you used the control panel to delete the files on your server, you will need to do several things in the following order
  1. Method A: If you have already installed the a new version of xcart, you would have RENAMED the old xcart folder which still has the old "templates_c" directory inside it.
  2. STEP 1. RENAME the NEW xcart directory to whatever you like.
  3. STEP 2. RENAME the OLD xcart directory BACK TO "XCART".
  4. STEP 3. Using your CP RESTORE the template_c directory (should be in the TRASHCAN directory of your server)
  5. STEP 4. COPY "cleanup.php" FROM your new xcart installation to the RESTORED xcart ROOT directory.
  6. STEP 5. Access the "cleanup.php" file using your BROWSER (see #3 above) This will remove ALL the compiled files in "template_c", and allow you to delete all the directories belonging to the old installation.
  7. STEP 6. RENAME your NEW xcart installation BACK to xcart.
  1. NOTE: If you do not have another installation of xcart on your server, but still have the UN-Deleted "xcart/templates_c" directory from a PREVIOUS install on your server, RESTORE and RENAME this old installation (if it's in the TRASHCAN). Next INSTALL your new copy or upgrade version of xcart, then follow the above steps to remove the OLD installation of xcart with the "un-deleted templates_c" directory..
[/list:cb91256480]

Regards,
__________________
Syddos

Nothing is impossible, We just don't know how to do it ........Yet!

Xcart 4.1.X PRO (Testing Platform: winXP Pro)
Perl 5.8.7 (win32)
WINAMP 1.6.3 (win32 server package. Includes the following)
- phpMyAdmin v2.8.03
- MySql 5.0.21
- Apache 2.0.55 (win32)
- php 5.1.4
- SQLitemanager 1.2.0
Reply With Quote
  #5  
Old 10-12-2002, 08:30 PM
 
matt matt is offline
 

Advanced Member
  
Join Date: Oct 2002
Location: LA, Calif.
Posts: 47
 

Default

Hi Syddos,

Thanks for the detailed reply


Matt
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 04:14 AM.

   

 
X-Cart forums © 2001-2020