Carma get extended
Applies to CARMA Version 1.0.12 or greater
Aliases: carma_get_extended_data, carma_extended, carma_extended_data
- Purpose: get extended data for a content set, picture, or video clip
- Usage: {carma_extended galid=1}
- Required parameters: galid
- Optional parameters: file, var, type (required for videos)
- Default Templates Used: none
- Variables created: $carma_extended
Parameters
(Required parameters in bold)
Parameter | Description | Possible Values | Default Value | Example |
---|---|---|---|---|
galid | Display this gallery's extended data | Any valid gallery number | None. You must provide a valid gallery number | galid="123" |
actorid | Get extended data from this actor | The numeric I.D. of the actor to get extended data from | None. | actorid="123" |
file | The file to get data from | numeric id or file name | None. | file="123" |
type | Type of content to get (note: type must be set if galid is a video.) | Any valid content type | None. | type=gal |
var | Smarty variable to assign the data to | Any valid Smarty variable name | carma_extended | var="my_var" |
You must set either galid or actorid.
Description
Retrieve Extended Data from a content set, a single picture, a single clip, or an actor. The extended data stored is parsed for XML and both the raw data and the parsed XML can be accessed using the following variables created:
- $carma_extended.raw - raw data
- $carma_extended.parsed - XML parsed data
$carma_extended.parsed is the root of the XML data. Each root-tag is an item of that array. XML allows you to have multiple tags with the same name for the same parent, so each tag name points to an array. The parent arrays items are each child tag name in the order they are added. To access attributes of each item, use _attrib and to access cdata of each item, use _cdata. Each item can of course also have child-tags.
For example, the following XML tree,
<data> <title>The Title</title> <items> <item name="test">Foo</item> <item name="another test">Bar</item> </items> </data>
creates the following array structure,
$carma_extended.parsed.DATA[0].TITLE[0]._cdata - "The Title" $carma_extended.parsed.DATA[0].ITEMS[0].ITEM[1]._attrib.name - "another test" $carma_extended.parsed.DATA[0].ITEMS[0].ITEM[0]._cdata - "Foo"