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

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s