How do we get root page id and root page title of current page in typo3


If we are on 3rd level of page that time we need root page id of current page then following script will help you more.

$GLOBALS['TSFE']->rootLine[0]['uid'];

you will get root page id of current page

Id you want to root page title then you may use following script

$GLOBALS['TSFE']->rootLine[0]['title'];

If you want all the level of the page tree then you will get array all array from following script

Simply print the following function you will get all level of page tree

$GLOBALS['TSFE']->rootLine;

I hope it will work for you and make your day 😉

If you have any queries, please do not hesitate to contact me at Jainish Senjaliya

Leave a comment