SEARCH:
Previous: dYear Next: AddControl

JoomlaCompatibility

string Template_Name
string Template_Color


This function generates objects, variables and defines that satisfy a Joomla template so that it will execute and serve up Andromeda content.

The first parameter is the name of the template to use. The template files should be in a subdirectory of your app's "templates" directory, and that subdirectory should have the same name as the template.

The second parameter, which defaults to blank, is assigned to $GLOBALS['template_color'].

Other actions of this program are:

  • defines constant _VALID_MOS as true
  • defines constant _ISO as empty
  • assigns the application's root directory to global variable $mosConfig_absolute_path.
  • assigns an empty string to global variable $mosConfig_live_site.
  • creates empty global $my object with property 'id' set to false
  • creates empty global $mainframe object, whose getTemplate() method always returns the template name.

The universal dispatcher, index_hidden, looks for the defined constant _VALID_MOS, and if found it uses the named Joomla template instead of an Andromeda template. It also exposes the necessary global variables that were defined above.

The compatibility layer provides a handful of functions to emulate the functions used by Joomla. The most important function is mosMainBody, which calls directly to ehStandardContent. The other functions tend toward being more placeholders.

When you use a Joomla template, there are a handful of tasks that must be performed:

  • Insert a link to the Andromeda javascript library, raxlib.js into the template.
  • Code up routine appCountModules, which handles calls to Joomla function mosCountModules.
  • Code up routine appShowModules, which handles calls to Joomla function mosLoadModules.
  • Identify the template's CSS classes for menu modules and menu items, and assign them in applib using vgaSet to 'MENU_CLASS_MODL' and 'MENU_CLASS_ITEM'.
  • Look for any hard-coded configuration parameters that you want to override and REM them out.
  • Copy the x2.css file from andro/clib into the template's CSS directory, and link to it from the template main file.

Previous: dYear Next: AddControl