b13 / menus

TYPO3 Extension for creating fast menus in a fast fashion
GNU General Public License v2.0
54 stars 21 forks source link

TreeMenu: "isCurrentPage" and "isInRootLine" are undeclared from level 2 on downwards #23

Closed moe2k closed 4 years ago

moe2k commented 4 years ago

I have a page tree with up to 4 levels which I all want to display in a mega menu (tree menu). Using treeMenu, everything works as expected down to level 1 (subpage), but as soon as I iterate down on level 2 (subpages of subpages = subsubpages), the state variables are not present anymore.

What am I missing?

Example Fluid Template:

<f:for each="{mainmenu}" as="page">
    <f:debug title="page {page.uid}.isCurrentPage">{page.isCurrentPage}</f:debug>
    <f:debug title="page {page.uid}.isInRootLine">{page.isInRootLine}</f:debug>
    <f:for each="{page.subpages}" as="subpage">
        <f:debug title="subpage {subpage.uid}.isCurrentPage">{subpage.isCurrentPage}</f:debug>
        <f:debug title="subpage {subpage.uid}.isInRootLine">{subpage.isInRootLine}</f:debug>
        <f:for each="{subpage.subpages}" as="subsubpage">
            <f:debug title="subsubpage {subsubpage.uid}.isCurrentPage">{subsubpage.isCurrentPage}</f:debug>
            <!-- this always returns NULL even if I'm on the current page -->
            <f:debug title="subsubpage {subsubpage.uid}.isInRootLine">{subsubpage.isInRootLine}</f:debug>
            <!-- this always returns NULL even if the current page is in rootline -->
        </f:for>
    </f:for>
</f:for>

TypoScript:

lib.mainmenu = FLUIDTEMPLATE
lib.mainmenu {
    dataProcessing.10 = B13\Menus\DataProcessing\TreeMenu
    dataProcessing.10.entryPoints = 1
    dataProcessing.10.depth = 3
    dataProcessing.10.as = mainmenu
    templateName = Mainmenu
    templateRootPaths {
        10 = EXT:my_provider/Resources/Private/Templates/Fluidtemplate
    }
}
moe2k commented 4 years ago

I close this issue as I just noticed it is a duplicate of https://github.com/b13/menus/issues/9 which is fixed in dev-master.

Looking forward to a new release though :-)