I was just reading the page on Runtime Asset Creation on the create asset tutorial. It didn't give too much detail about how to use the function, so here are my questions.
Which file would this function go into? <asset>.inc?
Where should I call the function from?
Here is the example I am going to work off of:
function createBodyCopy() { // new Bodycopy object $asset =& new Bodycopy(); // we need to link the new asset under this asset, with type 2 link, // it will be dependant and exclusive $link = Array( 'asset' => &$this, 'value' => 'page_contents', 'link_type' => SQ_LINK_TYPE_2, 'is_dependant' => 1, 'is_exclusive' => 1, ); // set the name of the new asset $asset->setAttrValue('name', 'Page Contents'); // try to create the new asset if (!$asset->create($link)) { echo translate('failed_to_create_asset'); return FALSE; } return TRUE; }