2017-06-19 54 views
0

我在搜索与子类别和相关项目数量相关的新闻类别菜单。搜索新闻类别菜单的输入框

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

这Typo脚本似乎没有在TYPO3 8.7.1

工作的项目数是错误的和子类别下的每个主类别重复。

有人有工作脚本吗?

+0

试试我的视图助手HTTPS ://stackoverflow.com/questions/44119101/typo3-tx-news-need-viewhelper-for-show-count-of-entities-in-category/44153942#44153942 –

回答

0

可以调整类别https://github.com/georgringer/news/blob/master/Resources/Private/Templates/Category/List.html 流体模板,并使用计数视图助手有 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>