【问题标题】:Typo3 extbase - HMENU with multiple recordsTypo3 extbase - 具有多条记录的 HMENU
【发布时间】:2014-01-14 14:40:31
【问题描述】:

我有一个带有“详细信息”视图的产品扩展。 “产品”记录保存在 ID 为 5 的文件夹中。 当我在使用产品时,我希望有一个菜单,其中包含指向该文件夹中所有产品的链接。 这在 Typoscript 中可能吗?

谢谢。

【问题讨论】:

  • 我浏览了文档并找不到起点,所以我最终为此制作了一个插件。

标签: typo3 typoscript records


【解决方案1】:

您可以使用 TypoScript 做任何事情 :-)。

lib.productList = CONTENT
lib.productList {
  table = tx_myext_domain_model_product
  select {
    # sorting criterion
    orderBy = tstamp DESC
    # PID list
    pidInList = 46,47
    # Maybe restrict the number of results
    max = 20
  }
  # Each result must be rendered like this
  renderObj = COA
  renderObj {
    1 = TEXT
    # Each field from your table can be used
    1.field = title
    1.wrap = <h1>|</h1>

    2 = TEXT
    2.field = description
    # If one field contains rich text, you can apply RTE parsing to it
    2.parseFunc < lib.parseFunc_RTE
  }

}

现在您可以使用 cObject ViewHelper 在 Fluid 模板中显示您的列表:

<f:cObject typoscriptObjectPath="lib.productList"></f:cObject>

【讨论】:

    猜你喜欢
    • 2017-07-23
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-05-28
    • 1970-01-01
    相关资源
    最近更新 更多