[TYPO3-dev] Manually rendering Content elements in BE

Steffen Kamper steffen at dislabs.de
Mon May 7 16:58:16 CEST 2007


"Jens Mittag" <jens.mittag at prime23.de> schrieb im Newsbeitrag 
news:mailman.204150.1178548944.21067.typo3-dev at lists.netfielders.de...
> Oops, don't know if my last mail came along with the attachment (I don't
> see it in the archive),so here is a downloadable link to it:
>
> http://www.m00re.de/fileadmin/typo3FeInitialization.phps
>
> Sorry for the mistake.
>
> Jens
>

Hi Jens,

for rendering any CE there is a function in cObj:
function cObjGetSingle($name,$conf,$TSkey='__')

This function does the whole job, so all we need is a working cObj ;-)

so for normal CE's i did it in FE like this:

function getCE($id) {
        $conf['tables']='tt_content';
        $conf['source']=$id;
        $conf['dontCheckPid']=1;
        return  $this->cObj->cObjGetSingle('RECORDS',$conf);
}

to find the right id for TV i did this:
function tvRecords() {
        $id=array();
        $res=$GLOBALS['TYPO3_DB']->exec_SELECTquery('*','pages','hidden=0 
and deleted=0 and uid in('.$this->pidList.')');
        while($page=$GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
            $xml=$page['tx_templavoila_flex'];
            $ces=t3lib_div::xml2array($xml);
            foreach($ces['data']['sDEF']['lDEF'] as $key=>$val) {
                $id=array_merge($id,explode(',',$val['vDEF']));
            }
        }
        return $id;
}


vg  Steffen 






More information about the TYPO3-dev mailing list