Her er du:


Codesnippets for ZOO CKK Development

Collection of random usefull snippets used in Yootheme ZOO CCK

Access the value of a element

General information

$myelement = $item->getElement('ccd051d9-b21d-49a3-8a7e-c3421b2e140b');
echo $myelement->get('value');

ZOO instance

General information

$zoo = App::getInstance('zoo');

//Get the active application
$app = $this->app->zoo->getApplication();
//Get the categories of this app
$categories = $app->getCategories();

Data Object

Object with table data based on paramaters

$ID = itemID
$Tablename = The table name

$object = $this->app->table->$Tablename->get($id)
Creates dataobject with the data available from $tablename where $id is matched.

In SQL it would look like this:
SQL=SELECT * FROM crea_zoo_application WHERE id = $id

Translate Alias to ID

Search alias in databasetable and get the id

$Tablename = "The table name" (ex. application)
$theIDofAlias = $this->app->alias->$name->translateAliasToID('theNameOfTheAlias');

ZOO Element Parameters

How to get values from the element configuration
(the parameters set under; “Edit Element”)

The paramenter is stored in the CONFIG-file
path: /public_html/media/zoo/applications/download/types

JRequest in ZOO

Fetch data from POST OR GET

Example Fetch elements from the URL
You have this URL: http://www.crea-aalborg.dk/administrator/index.php?option=com_zoo&controller=manager&task=types&group=download

You would like to get the value of URL-element: "group"
$group = $zoo->request->getString('controller');
Then $group will be: "download"

Get all application instances or all application instances in a certain group

Helper function: getApplications($group)

Returns array with all application instances

Returns array with all application instances in the group "download"

Oprettet af: Casper Nøhr Hansen | I kategori: Joomla! | Oprettet: Tirsdag, 21 oktober 2014 | Opdateret: Onsdag, 15 Juli 2015

Comments (0)

Leave a comment

You are commenting as guest.