[Typo3] parent pid of pid in pi (extension

christian oettinger christian.oettinger at gmx.de
Fri Jan 28 17:14:51 CET 2005


I know notice, that in my thread I was a bit confused with pid and uid, 
sorry:
So now a solution (This may not be the elegant way, but it works):

I cache the table pages (only the fields I need for speed reasons):

			if (!count($this->oePageCache)) {			
				$query = 'SELECT uid, pid, title FROM pages ORDER by uid'.
				$this->cObj->enableFields('pages');
				$res = mysql(TYPO3_db,$query);
				while($row=mysql_fetch_assoc($res)) {
					$this->oePageCache[$row['uid']]=$row;
				}
			}


Then:

$oeuidofparentpage = $this->oePageCache[UID_OF_PAGE_I_KNOW]['pid'];

(For also in pages there is a pid that tells where the record (in this 
case the page) lies. So in Words the upper statement means. Tell me the 
filed pid of the page of which I know the uid. This pid then is the uid 
of the parent page I search)
Then I can go on and read out other fields of this parent page:

$field_I_want ? $this->oePageCache[$oeuidofparentpage]['FILED_I_WANT']
(Notice that this field has to be cached in SELECT query on top)

greetings from munich

christian



More information about the TYPO3-english mailing list