【问题标题】:TYPO3 Render content from subpages via typoscriptTYPO3 通过打字稿从子页面呈现内容
【发布时间】:2018-04-04 15:28:54
【问题描述】:

我是打字新手。我试图从存档页面上的某些子页面呈现内容。

我不确定为什么我的代码什么也不显示。

首先我试图遍历我的子页面

在该代码中

  stdWrap.wrap = <div class="row"> | </div>
table = pages
select {
    orderBy = sorting
    # If this element is inserted as sitemap, consider the startingpoint
    pidInList.field = uid
    #max = 1
    begin = 0
  }

其次,我正在遍历我的 tt_content 表并尝试获取列标题的值并将其呈现在我的存档页面上。

代码一直有效,直到

<div class="row"> | </div>

完整代码在这里:

lib.content = COA
lib.content {
  stdWrap.wrap = <div class="row"> | </div>
    table = pages
    select {
            orderBy = sorting
        # If this element is inserted as sitemap, consider the startingpoint
            pidInList.field = uid
      #max = 1
      begin = 0
        }
    renderObj = COA
    renderObj {
      stdWrap.wrap = <div class="testfestinner"> | </div>

      10 = CONTENT
      10.wrap = <h3>|</h3>
      10 {
        table = tt_content
                select {
                    pidInList.field = uid
                    where = colPos = 212
                    orderBy = sorting
                }

        renderObj = COA
        renderObj.10 = TEXT
        renderObj.10.field = header
      }
    }
}

我不确定在哪里以及如何调试该代码。 提前致谢。

【问题讨论】:

  • 如果您有更好的想法来创建存档页面。请告诉我。
  • 正如乔伊所说:你的lib.content 需要是CONTENTobject。您的外部CONTENT 对象的替代方法可以是HMENU(任何页面/页面uid 列表都可以是菜单),您可以在其中添加内部CONTENT。亲:你甚至可以在一个页面树中组织你的档案,而不是在一个层次上一长串子页面。

标签: typo3 typoscript typo3-8.x


【解决方案1】:

table = pages 之类的内容不能直接分配给 COA。 为此,您需要一个 CONTENT 类型的 cObject。就像你分配给 renderObj 的那个。

【讨论】:

  • 非常感谢!你帮我做了那个。愿你有一个提示我如何在打字稿中变得更好......官方文档很好,但我可能需要另一个来源。你也有调试我的打字稿的提示,因为如果我犯了错误,我会感到孤单?
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2022-10-24
  • 1970-01-01
  • 1970-01-01
  • 2021-06-06
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多