[Typo3] How to get parent id of current page?
Dmitry Dulepov
typo3 at fm-world.ru
Thu Oct 27 12:04:14 CEST 2005
Hi!
PaweЁ StanisЁawczuk wrote:
> How to get parent ID of current page? i.e we are in main1/sub3
>
> root
> --main1(uid:1)
> ----sub1(uid:3)
> ----sub2(uid:4)
> ----sub3(uid:5)
> --main2(uid:2)
> ----sub1(uid:6)
> ...
> ..
> .
>
> how can I get the main1 UID while being in sub3 ?
> I'm creating a php function in 'example_callfunctions.php' so I'm searching
> a variable some sort. I'm getting my UID of current page (ie sub3's UID)
> with this:
>
> .intval($GLOBALS['TSFE']->id).
>
> works great, now what to do to receive parent ID (ie main1's UID) ?
$GLOBALS['TSFE']->page['pid']
$GLOBALS['TSFE']->page is a record for the current page from 'pages'
table. 'pid' is parent page ID.
Dmitry.
More information about the TYPO3-english
mailing list