0

need to access any information from zoo component from anywhere, like app information, elements from a app template. In this case i need to access to this information from my Joomla 3 template to make a dynamic-custom CSS.

In joomla you can get the template name from anywhere with something like this:

$app = JFactory::getApplication();
$template = $app->getTemplate();

I am looking for something like that for zoo.

Thanks in advance!!

Shalom
  • 15
  • 1
  • 7

2 Answers2

0

It's not as easy as that as its not a core component but you can get element data for example:

http://paulmason.name/item/yootheme-zoo-accessing-element-data-with-joomla-code

You can always write code to fetch the json data from their database tables and access it that way.

tonypartridge
  • 292
  • 1
  • 9
0

You can do this by calling:

    // make sure ZOO exists
    if (!JComponentHelper::getComponent('com_zoo', true)->enabled) {
        return;
    }

    // load ZOO config
    jimport('joomla.filesystem.file');
    if (!JFile::exists(JPATH_ADMINISTRATOR.'/components/com_zoo/config.php') || !JComponentHelper::getComponent('com_zoo', true)->enabled) {
        return;
    }
    require_once(JPATH_ADMINISTRATOR.'/components/com_zoo/config.php');

    // make sure App class exists
    if (!class_exists('App')) {
        return;
    }


    // Get the ZOO App instance
    $zoo = App::getInstance('zoo');

The $zoo var now holds the ZOO app instance. From there you can start to run ZOO specific tasks and run event handlers etc.

Ray Lawlor
  • 368
  • 1
  • 4
  • 13