Scopestyle
Scopestyle

Reputation: 665

How to include a constant in a TYPO3 Fluid VHS menu

I have a simple menu generated by the Fluid Menu ViewHelper:

<v:page.menu useShortcutData="TRUE" levels="3" expandAll="1" class="menu" classActive="act" substElementUid="1" excludePages="12,13,3" />

There are multiple languages and each language has different pages hidden in the navigation that I would like to change in the "excludePages" part.

In Typoscript I would simply use a constants marker like {$exclude}. Adding the marker in fluid breaks the menu. What would be the way to achieve this in an inline Fluid setup like this?

Upvotes: 1

Views: 1681

Answers (1)

nbar
nbar

Reputation: 6158

There are different ways to get constant into Fluid.

1. Include form TypoScript

{f:cObject(typoscriptObjectPath: 'lib.myConstant')}

2. Save in settings from your ext.

plugin.tx_myext.settings {
  myonstant = TEXT
  myconstant = 1,2,3
}

3. Configuration in Page Template (the pure fluid way)

<f:section name="Configuration">
    <flux:form id="mypage" options="{icon: 'Icons/Page/Standard.gif'}">
        <flux:field.tree name="myConstantFromTRee" table="pages" parentField="pid" expandAll="0" multiple="1" minItems="0" maxItems="0" label="myConstantFromList" foreignLabel="title" size="10"/> 
    </flux:form>
    <flux:grid>
        <flux:grid.row>
            <flux:grid.column colPos="0"  name="main" />
        </flux:grid.row>
    </flux:grid>
</f:section>

And access it with {settings.myConstantFromTRee}.

Upvotes: 1

Related Questions