【问题标题】:typoscript for a news category menu searched搜索的新闻类别菜单的打字稿
【发布时间】:2017-06-19 05:39:30
【问题描述】:

我正在搜索包含子类别和相关项目数量的新闻类别菜单。

现有: https://www.fiedomedia.de/news/artikel/news-kategorien-mit-counter/

这个打字稿似乎在 TYPO3 8.7.1 中不起作用

项目数量错误,每个主要类别下的子类别都重复。

有人有工作脚本吗?

【问题讨论】:

标签: typo3 tx-news


【解决方案1】:

您可以调整类别https://github.com/georgringer/news/blob/master/Resources/Private/Templates/Category/List.html的流体模板 并在那里使用 count-viewhelper https://fluidtypo3.org/viewhelpers/fluid/master/CountViewHelper.html

前段时间我用 dateMenu 做过类似的事情:

<f:section name="content">
    <ul class="vertical menu">
        <f:for each="{data.single}" key="year" as="months">
            <li>
                <a>{year}</a>
                <ul class="vertical menu nested">
                    <f:for each="{months}" key="month" as="count">
                        <f:if condition="{0:year, 1:month} == 
{0:overwriteDemand.year, 1:overwriteDemand.month}">
                            <f:then>
                                <li class="item active">
                            </f:then>
                            <f:else>
                                <li class="item">
                            </f:else>
                        </f:if>
                            <f:link.action pageUid="{listPid}" arguments="
{overwriteDemand:{year: year, month: month}}"><f:translate key="month.
{month}" /> {year}
({count})</f:link.action>

                        </li>
                    </f:for>
                </ul>
            </li>
        </f:for>
    </ul>
</f:section>

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2020-03-26
    • 2023-01-11
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-03-09
    相关资源
    最近更新 更多