Bernd Wilke πφ
Bernd Wilke πφ

Reputation: 10800

how to exclude pages from menu generation with ext:fluid_styled_content?

If I define a menu in typoscript I can use excludeUidList to exclude some pages.

With CSC if I want my sitemap CE to exclude some pages I could define it at tt_content.menu.2.

With FSC the menu-genration moved into the fluid-templates with the usage of the ce:menu.directory viewhelper but there I can not find any option to exclude a list of pages (I don't want to have a bunch of f:if VHs in the fluid templates to avoid a list of uids)

Upvotes: 0

Views: 1452

Answers (1)

ntiedt
ntiedt

Reputation: 183

You can still use TS and include it to your fluidtemplate with

  1. cObject-Viewhelper. (TYPO3 >= 7.6)

    TS:

    lib.yourmenu = HMENU
    lib.yourmenu.special = list
    lib.yourmenu.special.value = 35, 56
    

    Fluid:

    <f:cObject typoscriptObjectPath="lib.yourmenu" />
    

Another approuch is to use

  1. Fluid data processors. (TYPO3 >= 8.5)
    See Feature: #78672 - Introduce fluid data processor for menus
    or TypoScript Reference -> HMENU

    TS:

    page.10 = FLUIDTEMPLATE
    page.10 {
        dataProcessing {
            10 = TYPO3\CMS\Frontend\DataProcessing\MenuProcessor
            10 {
                special = list
                special.value = 35, 56
                as = yourMenu
            }
        }
    }
    

    Fluid:

    <ul>
        <f:for each="{yourNav}" as="yourNavItem">
            <li class="{f:if(condition: yourNavItem.active, then:'active')}">
                <a href="{yourNavItem.link}" target="{yourNavItem.target}" title="{yourNavItem.title}">
                    {yourNavItem.title}
                </a>
                <f:if condition="{yourNavItem.children}">
                    <ul>
                        <f:for each="{yourNavItem.children}" as="child">
                            <li class="{f:if(condition: child.active, then:'active')}">
                                <a href="{child.link}" target="{child.target}" title="{child.title}">
                                    {child.title}
                                </a>
                            </li>
                        </f:for>
                    </ul>
                </f:if>
            </li>
        </f:for>
    </ul>
    

Upvotes: 0

Related Questions