1
Fritz
Editing Template Files
  • 2004/5/6 15:45

  • Fritz

  • Just popping in

  • Posts: 47

  • Since: 2004/5/5 1


As a beginner with XOOPS, I have been trying to edit the physical template files and upload them via ftp to my web site directory, only to find that the change does not show up.

By examining the MySQL database, I finally discovered that the source code for each template file is actually stored in a database table, and must be edited there through the XOOPS administration interface.

This makes sense to me now, but it was very confusing to me before I figured it out, and there doesn't seem to be much mentioned about it in the documentation.

What doesn't make sense to me is: Why are there physical files in the templates_c directory when they aren't actually used?

2
tl
Re: Editing Template Files
  • 2004/5/6 16:58

  • tl

  • Friend of XOOPS

  • Posts: 999

  • Since: 2002/6/23


Hope this will help you out

ThemesVsTemplates

As explained in the WIKI, you need clone the default template and set it as the default. You could either edit cloned templates online or upload edited ones via the template manager.


3
Mithrandir
Re: Editing Template Files

or update the modules, which templates have changed.

Templates_c ARE used - but by the Smarty engine. They are compiled templates.

4
Fritz
Re: Editing Template Files
  • 2004/5/6 18:04

  • Fritz

  • Just popping in

  • Posts: 47

  • Since: 2004/5/5 1


Quote:
Templates_c ARE used - but by the Smarty engine. They are compiled templates.


Thanks for the responses!

What do you mean by "compiled templates". How are they used? Do you mean that they "WERE" used (compiled) at the time of the installation, but are no longer relevant after the installation?

Thanks!

5
Mithrandir
Re: Editing Template Files

No - it's a bit of a long explanation, but if I have got it right, it goes like this:

When a page is requested, XOOPS/Smarty looks for one of these files to display - the code in the files in templates_c is normal php code, but it is made (compiled) from the template by the Smarty engine the first time the page is requested. If the page doesn't exist, Smarty looks in the database for the template and compiles it to a file in the templates_c folder.

6
Fritz
Re: Editing Template Files
  • 2004/5/6 18:35

  • Fritz

  • Just popping in

  • Posts: 47

  • Since: 2004/5/5 1


First, thank you very much for your time, Mithrandir!

Ooooh, now it's making a little more sense.

But, if we make a change to a template via the Template Set Manager, that change appears to only be reflected in the source code stored in the database and NOT in the physical file in the templates_c folder.

So if newer source code exists in the database, does an existing template file in the templates_c folder get re-compiled when a request for made that involves that template?

Humbly,
Fritz

7
Mithrandir
Re: Editing Template Files

that is the idea, yes.

The flow is like this:
Template file -> database (on module installation/update) -> templates_c (first time page is requested)

If the template exists in a newer version in the database, the templates_c file will be re-compiled.

If you only change the file, the database contents is still intact and the templates_c file will not be re-compiled.

8
Fritz
Re: Editing Template Files
  • 2004/5/6 18:42

  • Fritz

  • Just popping in

  • Posts: 47

  • Since: 2004/5/5 1


Excellent.

Again, my thanks!
Fritz

Login

Who's Online

193 user(s) are online (118 user(s) are browsing Support Forums)


Members: 0


Guests: 193


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: May 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits