【问题标题】:Set Category title as header in list view (TYPO3 tx_news)将类别标题设置为列表视图中的标题 (TYPO3 tx_news)
【发布时间】:2017-08-13 18:48:44
【问题描述】:

我想将类别标题添加到列表视图元素,类别菜单会将您发送到该元素。我只是没有弄清楚...

这是我在流体模板中的代码:

Templates/News/List.html
<div class="news-list-view">
    <f:if condition="{categories.0.headline}">
        <f:then>
            <h1>{categories.0.headline}</h1>
        </f:then>
        <f:else>
            <h1>News Category</h1>
        </f:else>
    </f:if>

【问题讨论】:

    标签: typo3 tx-news


    【解决方案1】:

    类别中没有字段headline。使用title 应该会很好。

    【讨论】:

      【解决方案2】:

      你可以这样做。

      <f:if condition="{news.0.categories}">
          <f:then>
              <f:for each="{news.0.categories}" as="Category">
                 <h1>{Category.title}</h1>
              </f:for>
          </f:then>
          <f:else>
              <h1>News Category</h1>
          </f:else>
      </f:if>
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多