[TYPO3-english] Automatic adding of extension to page
Gijs Epping [eFocus]
gijs.epping at efocus.nl
Mon Dec 8 13:01:55 CET 2008
Gijs Epping [eFocus] schreef:
> Hello,
>
> Is there a extension or a tutorial that describes how to automaticly add
> a extension to a newly created page.
>
> The idea is the user has a allready configured page when he starts.
>
> Kind Regards Gijs
>
>
Already found out how, i just added an
processDatamap_afterDatabaseOperations hook and checked for the current pid
It looks like this:
function processDatamap_afterDatabaseOperations($status, $table, $id,
$fieldArray, &$reference)
{
$pid = $reference->getPID($table, $id);
if($table=='pages' && $status=='update' && $pid=49){
$fieldArray2 = array();
$fieldArray2['header'] = 'Newletter'.date('d-m-Y');
$fieldArray2['pid'] = $id;
$fieldArray2['CType'] = 'list';
$fieldArray2['cruser_id'] = 1;
$fieldArray2['tstamp'] = time();
$fieldArray2['crdate'] = time();
$fieldArray2['list_type'] = 'pluginname_pi1';
$fieldArray2['sectionIndex'] = 1;
$fieldArray2['filelink_size'] = 1;
$fieldArray2['sorting'] = 256;
$reference->insertDB('tt_content',null,$fieldArray2);
}
}
more information about hooks
http://typo3.org/development/articles/how-to-use-existing-hooks/
--
E: gijs.epping at efocus.nl
W: http://www.efocus.nl/
W: http://www.gijs.com/
################
# eFocus is looking for Typo3/Php Developers
# http://www.werkenbijefocusgroep.nl/
################
More information about the TYPO3-english
mailing list