Difference between revisions of "Using Templates and Language Files"

From GeeklogWiki
Jump to: navigation, search
m (added link to Translations page)
m (fixed & prettyfied links)
Line 1: Line 1:
 
== Templates ==
 
== Templates ==
  
Most of the Geeklog code has isolated all of the display HTML into templates using the template engine from Phplib. See http://phplib.sf.net. If you need some help on template usage see: http://www.phpbuilder.com/columns/david20000512.php3 and http://www.devshed.com/Server_Side/PHP/PHPLib/page1.html.  
+
Most of the Geeklog code has isolated all of the display HTML into templates using the template engine from [http://phplib.sourceforge.net/ PHPLib]. If you need some help on template usage see [http://www.phpbuilder.com/columns/david20000512.php3 Templates, The PHPLIB Way] and [http://www.devshed.com/c/a/PHP/PHPLib-Templates/ PHPLib Templates].
  
 
Geeklog's use of template files allows for the easy creation of themes. Your use of templates will make it easier to include your plugin or block in the theme system.
 
Geeklog's use of template files allows for the easy creation of themes. Your use of templates will make it easier to include your plugin or block in the theme system.

Revision as of 15:32, 17 May 2009

Templates

Most of the Geeklog code has isolated all of the display HTML into templates using the template engine from PHPLib. If you need some help on template usage see Templates, The PHPLIB Way and PHPLib Templates.

Geeklog's use of template files allows for the easy creation of themes. Your use of templates will make it easier to include your plugin or block in the theme system.


Language Files

Geeklog separates all the display language into separate language files so that the entire website can be translated without changing the code. The use of language files will allow your plugin or block to also be used worldwide without the changing of your code. Geeklog is used worldwide. The format of the Geeklog language file is a series of arrays, one for each of your display files in the following format:

$LANG_{plugin-name}XX[YY]:  $LANG - variable name
           XX - file id number
           YY - phrase id number (either numeric or string)

So that for a plugin called BAR you would have:

$LANG_BAR00 = array (
    'this'     => 'This',
    'that'      => 'That',
    'here'     => 'Here',
    'there'   => 'There'
);
or 
$LANG_BAR00 = array (
    1     => 'This',
    2     => 'That',
    3     => 'Here',
    4     => 'There'
);

Also see Translations.