根据colPos值更改类别菜单

时间:2019-04-13 10:45:44

标签: menu categories typoscript tx-news

在这里,我想根据colPos的值修改新闻系统扩展的Templates / Category / List.html。这是有问题的代码:

<f:section name="content">
<f:if condition="{categories}">
    <f:then>
        <f:render section="categoryTree" arguments="{categories:categories,overwriteDemand:overwriteDemand}" />
    </f:then>
    <f:else>
        <f:translate key="list_nocategoriesfound" />
    </f:else>
</f:if>
</f:section>

<f:section name="categoryTree">
<f:if condition="{colPos} == 99">
  <f:then>
    <!-- Render template with number 99 here -->
        <ul class="mtree bubba">
            <f:for each="{categories}" as="category">
                <li>
                    <f:if condition="{category.item.uid} == {overwriteDemand.categories}">
                        <f:then>
        <f:link.page title="{category.item.title}" class="active" pageUid="{settings.listPid}"
                                additionalParams="{tx_news_pi1:{overwriteDemand:{categories: category.item.uid}}}">{category.item.title}
                            </f:link.page>
                        </f:then>
                        <f:else>
                            <f:link.page title="{category.item.title}" pageUid="{settings.listPid}"
                                additionalParams="{tx_news_pi1:{overwriteDemand:{categories: category.item.uid}}}">{category.item.title}
                            </f:link.page>
                        </f:else>
                    </f:if>

                    <f:if condition="{category.children}">
                        <f:render section="categoryTree" arguments="{categories: category.children,overwriteDemand:overwriteDemand}" />
                    </f:if>
                </li>
            </f:for>
        </ul>
</f:then>

<f:else>
    <b>Another cat tree here !</b>
</f:else>
</f:if>

</f:section>

但是在模板中无法访问我开发的扩展程序的setup.txt中声明的变量colPos。我该怎么做才能获得其价值?

预先感谢

0 个答案:

没有答案