rupertgermann / tt_news

TYPO3 Extension - News (tt_news)
21 stars 37 forks source link

Fluid variables not working #183

Open Patta opened 3 years ago

Patta commented 3 years ago

It seems that variables are not working in fluid templates.

Example:

newsListTestPid setting is working, but the variable pageUid is not.

setup.typoscript

plugin.tt_news {

    useFluidRendering = 1

    view {
        templateRootPaths { ... }
        partialRootPaths { ... }
    }

    variables {
        pageUid = TEXT
        pageUid {
            field = pageUid
            ifEmpty.data = TSFE:id
        }
    }

    settings {
        newsListTestPid = {$newsListTestPid}
    }

    ...
}

List.html

<f:if condition="{content.news}">
    <f:then>

        <f:if condition="{pageUid} == {conf.settings.newsListTestPid}">
            <f:asset.css identifier="newstest" href="EXT:sitepackage/Resources/Public/Css/newsTest.css" media="all" />
        </f:if>

        <section class="news list">
            <f:for each="{content.news}" as="news">
                ...
            </f:for>
        </section>
    </f:then>
    <f:else>
        ...
    </f:else>
</f:if>