[TYPO3-dev] pidInList recursive

Markus Lange markus.lange at bgm-gmbh.de
Tue Nov 28 09:55:57 CET 2006


Hi Georg,
>Sorry no!
>Got something like this:
>temnp.foo = CONTENT
>temp.foo {
>  table = tt_content
>  select {
>    pidInList = 46,47,48,50
>    orderBy = tstamp DESC
>    where = colPos=0
>    languageField=sys_language_uid
>    max = 20

>  }
>
>  renderObj = COA_INT
>  renderObj {
>  }
>}

>and i want o fetch all tt_content elements, not just of pages with id
46->50, 
>but also from their subpages!


includeLibs.user_getpages = [PATH]/user_getpages.inc

.....  
pidInList.cObject = USER
pidInList.cObject {
    userFunc = user_getpages->main
    treeDepth = 3
}
.....

Content of user_getpages.inc 


<?php

class user_getpages {

 function main($content,$conf)	{
      global $TSFE;	
	$pid_list_arr = explode(",",$GLOBALS["TSFE"]->id);
	$pid_list="";
	while(list(,$val)=each($pid_list_arr))	{
 
$pid_list.=$val.",".$this->cObj->getTreeList($val,$conf["treeDepth"]);
      	}
	$pid_list = ereg_replace(",$","",$pid_list);
      return $pid_list;	
	}
?>

Tested and working but certainly could be improved and shortened

hth

markus






More information about the TYPO3-dev mailing list