I will finally succeed! Not sure though this is the best way. What do you think about this? Should I put the second choice in userFunc too?
fileadmin / UserFunc / mailArchive.php
<?php
class user_mailArchive {
function getFirstChild($content, $conf) {
$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
'uid',
'pages',
'pid='.intval($conf['pid']),
'',
'sorting',
'1'
);
$row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res);
if ($row) {
return $row['uid'];
}
else {
return '';
}
}
}
TS template
tmp.pagecontent < page.10.subparts.main-content
page.10.subparts.main-content >
includeLibs.mailArchive= fileadmin/userfunc/mailArchive.php
page.10.subparts.main-content = COA
page.10.subparts.main-content {
10 = CONTENT
10 {
table = tt_content
select {
pidInList.cObject = USER
pidInList.cObject {
userFunc = user_mailArchive->getFirstChild
pid = 139
}
orderBy = sorting
}
}
20 < tmp.pagecontent
}
source
share