当HMENU pid等于时,Typo3子菜单TMENU与if

时间:2016-02-15 09:10:31

标签: if-statement menu typo3 typoscript

我有一个带有子菜单的HMENU,如果主菜单点有uid xxx,我想添加第三个子菜单。

如果我实施此TypoScript代码,将显示所有第三个子菜单:

3 = TMENU
3 {
    stdWrap.outerWrap = <div class="submenu-third-level"><ul class='submenu'>|</ul></div>
    stdWrap.outerWrap.override = <div class="submenu-third-level show"><ul class='submenu'>|</ul></div>
    stdWrap.outerWrap.override.if {
        value.data = field:pid
        isInList = 588
    }
    stdWrap.insertData = 1
    NO.wrapItemAndSub = <li class="menu-item">|</li>

    ACT = 1
    ACT{
        wrapItemAndSub = <li class="menu-item active">|</li>
    }

    SPC = 1
    SPC {
       doNotLinkIt = 1
       doNotShowLink = 1
       allWrap = </ul><ul class='submenu'>
    }
}

因此,将显示子菜单的所有子菜单。但我想只显示HMENU PID XXX中子菜单的子菜单。

是否有可能这样做:

   3 = TMENU
    3 {
        stdWrap.outerWrap = <div class="submenu-third-level"><ul class='submenu'>|</ul></div>
        stdWrap.outerWrap.override = <div class="submenu-third-level show"><ul class='submenu'>|</ul></div>
        stdWrap.outerWrap.override.if {
            value.data = field:pid
            isInList = 588
        }
        stdWrap.insertData = 1
        NO.wrapItemAndSub = <li class="menu-item">|</li>

        ACT = 1
        ACT{
            wrapItemAndSub = <li class="menu-item active">|</li>
        }

        SPC = 1
        SPC {
           doNotLinkIt = 1
           doNotShowLink = 1
           allWrap = </ul><ul class='submenu'>
        }

        if {
            value.data = field:pid
            equals = xxx
        }
    }

2 个答案:

答案 0 :(得分:0)

你最好使用新的HMENU:

[Fact]
public void DatabaseModeler_provides_table_modeler()
{
    var q = new LightmapQuery<AspNetRoles>(new SqliteProvider2())
        .Where(role => role.Name == "Admin");
    var result = q.ToList();
}

如果没有,请发表评论

答案 1 :(得分:0)

感谢您的回复。我用不同的方式解决了它,效果很好。 我的解决方案:

3 = TMENU
3 {
    stdWrap.outerWrap = <div class="submenu-third-level"><ul class='submenu'>|</ul></div>
    stdWrap.if {
        value.data = field:pid
        isInList = {$menu.thirdSubmenuList}
    }

    NO.wrapItemAndSub = <li class="menu-item">|</li>

    ACT = 1
    ACT{
        wrapItemAndSub = <li class="menu-item active">|</li>
    }

    SPC = 1
    SPC {
       doNotLinkIt = 1
       doNotShowLink = 1
       allWrap = </ul><ul class='submenu'>
    }
}

条件决定是否显示菜单。

最好的问候