Difference between revisions of "Using Templates and Language Files"
m (Cosmetics) |
m (Cosmetics) |
||
(3 intermediate revisions by the same user not shown) | |||
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 | + | 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. | ||
Line 18: | Line 18: | ||
$LANG_BAR00 = array ( | $LANG_BAR00 = array ( | ||
− | 'this' | + | 'this' => 'This', |
− | 'that' | + | 'that' => 'That', |
− | 'here' | + | 'here' => 'Here', |
'there' => 'There' | 'there' => 'There' | ||
); | ); | ||
+ | |||
or | or | ||
+ | |||
$LANG_BAR00 = array ( | $LANG_BAR00 = array ( | ||
1 => 'This', | 1 => 'This', | ||
Line 31: | Line 33: | ||
); | ); | ||
</pre> | </pre> | ||
+ | |||
+ | Also see [[Translations]]. | ||
− | [[Category:Plugin Development]] | + | [[Category:Plugin Developers Handbook]] [[Category:Plugin Development]] |
Latest revision as of 14:31, 8 June 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.