Author Topic: Explanation for how the template works?  (Read 4158 times)

0 Members and 1 Guest are viewing this topic.

Offline vasche

  • Pre-Newbie
  • Posts: 2
    • View Profile
Explanation for how the template works?
« on: October 13, 2002, 11:07:16 AM »
Hello

Is there an explanation for how the templates work?

Offline Chris

  • 4images Moderator
  • 4images Guru
  • *****
  • Posts: 4.487
  • Did u ever stop to think and then forget to start?
    • View Profile
Brief explanation
« Reply #1 on: October 15, 2002, 06:20:53 PM »
The templates are parsed by 4images.  Anything enclosed within { and } is replaced with something provided what is between the curly braces is something that 4images knows about.

So {lang_SOMETHING} is replaced by the string assigned to SOMETHING found in lang/<your language>/main.php

For example:  Suppose lang/english/main.php has this line:
Code: [Select]
$lang['search'] = "Search Images";
In the templates, {lang_search} is replaced with
Quote
Search Images

Other template tags are replaced depending on session state and the php code itself.
{lightbox_button} could be replaced by any of these 3 buttons:

templates/<your template directory>/images/lightbox_off.gif
templates/<your template directory>/images/lightbox_no.gif
templates/<your template directory>/images/lightbox_yes.gif

Other tags are just a straight data substitution like this:
{image_description} is replaced with whatever description exists in the database for the image being displayed.

I don't know of any comprehensive list of all the available template tags.  Such a list would be nice though.