Get the parent pages of the current page in an extension

Is there a way to get all parent ids from a subpage via php?

...
Page
Page 12
    Subpage 21
    Subpage 22
        CurrentPage 23

      

Want to get 12.21

+3


source to share


1 answer


See array $GLOBALS['TSFE']->rootLine

.

it is indexed in natural order, which means index 0 is the root page and the last element is your current position.



So, in your case it would be: 0=>12

, 1=>22

,2=>23

Sorry to initialize an invalid description

+4


source







All Articles