如何从Typo3中的内容元素中的两个记录中获取值?

发布于 2025-02-09 08:41:00 字数 2250 浏览 2 评论 0原文

我在Typo3中创建了一个内容元素(VER。11.5.9)。 现在,我想用流体完成我的HTML文件。但是我无法从数据库表中显示我的数据。

内容元素的后端似乎是如此: ”“在此处输入图像描述”

在内容元素中,有两个选项卡,在每个选项卡中,我都可以添加一些子项目。

我在数据库中的表格是这样的:

  • tt_content
  • tx_anreisetag_item(这是Anreisetag的选项卡的表)
  • TX_ABREISETAG_ITEM(这是Abreisetag选项卡的表),

这些子项目的数据在表中放弃了tx_anreisetag_anreisetem 和tx_abreisetag_item

我在Anreisetag中添加了三个记录,并在Abreisetag中添加了两个记录。但是,如果我在前端检查调试,那么我只能看到两个记录abreisetag。我找不到anreisetag “在此处输入图像说明”

在Typoscript中我写了此代码:

tt_content.klassenfahrt_anundabreisetag >
tt_content.klassenfahrt_anundabreisetag =< lib.contentElement
tt_content.klassenfahrt_anundabreisetag {
templateName = AnundAbreisetag
    dataProcessing {
        20 = TYPO3\CMS\Frontend\DataProcessing\DatabaseQueryProcessor
        20 {
            table = tx_anreisetag_item
            pidInList.field = pid
            where {
                data = field:uid
                intval = 1
                wrap = tt_content=|
            }
            orderBy = sorting
        }
        

        30 = TYPO3\CMS\Frontend\DataProcessing\DatabaseQueryProcessor
        30 {
            table = tx_abreisetag_item
            pidInList.field = pid
            where {
                data = field:uid
                intval = 1
                wrap = tt_content=|
            }
            orderBy = sorting
        }  

        40 = TYPO3\CMS\Frontend\DataProcessing\FilesProcessor
        40 {
            references.fieldName = tx_anreisetag_image
            as = imageAnreise
         } 
         50 = TYPO3\CMS\Frontend\DataProcessing\FilesProcessor
         50 {
            references.fieldName = tx_abreisetag_image
            as = imageAbreise
         } 

      }
}

如何注册我的另一个记录anreisetag

我希望有人可以帮助我。谢谢。

I created a content element in TYPO3 (Ver. 11.5.9).
Now I want to finish my HTML-files with Fluid. But I can't display my data from my table of a database.

The Backend of the content element seems like so: enter image description here

In a content element there are two tabs and in every tab I can add some child items.

My table in a database is so:

  • tt_content
  • tx_anreisetag_item (this is a table for a tab of Anreisetag)
  • tx_abreisetag_item (this is a table for a tab of Abreisetag)

The data of the child items are saved in the tablestx_anreisetag_item and tx_abreisetag_item.

I added three records in Anreisetag and two records in Abreisetag. But if I check a debug in the frontend, then I can see just two records of Abreisetag. I can't find no object of Anreisetag: enter image description here

In typoscript I wrote this codes:

tt_content.klassenfahrt_anundabreisetag >
tt_content.klassenfahrt_anundabreisetag =< lib.contentElement
tt_content.klassenfahrt_anundabreisetag {
templateName = AnundAbreisetag
    dataProcessing {
        20 = TYPO3\CMS\Frontend\DataProcessing\DatabaseQueryProcessor
        20 {
            table = tx_anreisetag_item
            pidInList.field = pid
            where {
                data = field:uid
                intval = 1
                wrap = tt_content=|
            }
            orderBy = sorting
        }
        

        30 = TYPO3\CMS\Frontend\DataProcessing\DatabaseQueryProcessor
        30 {
            table = tx_abreisetag_item
            pidInList.field = pid
            where {
                data = field:uid
                intval = 1
                wrap = tt_content=|
            }
            orderBy = sorting
        }  

        40 = TYPO3\CMS\Frontend\DataProcessing\FilesProcessor
        40 {
            references.fieldName = tx_anreisetag_image
            as = imageAnreise
         } 
         50 = TYPO3\CMS\Frontend\DataProcessing\FilesProcessor
         50 {
            references.fieldName = tx_abreisetag_image
            as = imageAbreise
         } 

      }
}

How can I register my another records of Anreisetag?

I hope someone can help me. Thank you.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

卸妝后依然美 2025-02-16 08:41:00

您需要告诉databasequeryProcessor记录的名称。
如果您不添加

as = abreisetag

以及其他调用,则两个查询都存储在名为Records的变量中。然后,第一个查询将被第二个查询覆盖。

小提示:使用英语变量。

You need to tell the DatabaseQueryProcessor the name of the records.
If you don't add

as = abreisetag

and also for the other call, both queries are stored in the variable named records. Then the first query will be overwritten by the second query.

Small hint: Use english variables.

像极了他 2025-02-16 08:41:00

我无法确定,因为您尚未提供TCA和SQL声明,但我认为您使用UID访问了记录,这就是关系的计数。

Typo3插入具有记录计数的字段,其中记录关系存储在相关记录(作为后链接)或MM记录中。

I can't be sure as you have not provided your TCA and SQL declaration, but I assume you accessed the record with the uid, that is the count of relations.

TYPO3 inserts a field with the count of records, where the record relation is stored either in the related record (as a back link) or in mm-records.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文