Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/typo3/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Typo3 获取流体中的父/嵌套通量CE_Typo3_Fluid - Fatal编程技术网

Typo3 获取流体中的父/嵌套通量CE

Typo3 获取流体中的父/嵌套通量CE,typo3,fluid,Typo3,Fluid,是否可以在嵌套的CE中获取父CE类型/名称? 我有一个自定义通量网格CE,有两列,在这些列中可以放置另一个CE。现在我想检测孩子是否在网格内,如果是,那么做这个和那个。是的,打字3在很多方面都是可能的。内容元素是如何嵌套的?从父级到子级(templavoila)或从子级到父级(gridelements)?无论使用何种技术存储父级和子级之间的关系,您都可以选择FLUIDTEMPLATE参数数据处理 通过类似这样的数据库查询处理器创建变量子项或父项 tt_content.mycontent.20 =

是否可以在嵌套的CE中获取父CE类型/名称?
我有一个自定义通量网格CE,有两列,在这些列中可以放置另一个CE。现在我想检测孩子是否在网格内,如果是,那么做这个和那个。

是的,打字3在很多方面都是可能的。内容元素是如何嵌套的?从父级到子级(templavoila)或从子级到父级(gridelements)?

无论使用何种技术存储父级和子级之间的关系,您都可以选择FLUIDTEMPLATE参数
数据处理

通过类似这样的数据库查询处理器创建变量
子项
父项

tt_content.mycontent.20 = FLUIDTEMPLATE
tt_content.mycontent.20 {
   file = EXT:site_default/Resources/Private/Templates/ContentObjects/MyContent.html

   dataProcessing.10 = TYPO3\CMS\Frontend\DataProcessing\DatabaseQueryProcessor
   dataProcessing.10 {
      # regular if syntax
      if.isTrue.field = records

      # the table name from which the data is fetched from
      # + stdWrap
      table = tt_address

      # All properties from .select can be used directly
      # + stdWrap
      colPos = 1
      pidInList = 13,14

      # The target variable to be handed to the ContentObject again, can
      # be used in Fluid e.g. to iterate over the objects. defaults to
      # "records" when not defined
      # + stdWrap
      as = myrecords

      # The fetched records can also be processed by DataProcessors.
      # All configured processors are applied to every row of the result.
      dataProcessing {
         10 = TYPO3\CMS\Frontend\DataProcessing\FilesProcessor
         10 {
            references.fieldName = image
         }
      }
   }
}
您可以为该数据处理器使用
select
的所有参数,并且可以使用stdWrap属性修改每个参数

只需确保使用所需的变量名替换
as=myrecords
,然后直接从流体模板中访问此变量。您可以使用
{u all}
获得可用变量的概述

摘自这些文件


此外,您可能想看一看这段视频,了解数据处理是关于什么的。

由于FLUIDTEMPLATE方法是一种通用的方法,而这个问题可能与Flux更密切相关,因此这里有一种特定于Flux的将信息交给子记录的方法:

并在您的子记录中使用

10 = TEXT
10.dataWrap = My parent record is of type {register:parentRecordType}
基于注册信息的if条件或switch对象也是如此。 当然,对于基于流体的子记录渲染也是如此

只需使用
\u all
即可获得可用寄存器和数据的概览


与其说是回答,不如说是评论:(是的,对不起,应该是评论,因为回答这个问题需要反馈。您使用什么构造或扩展将CE堆叠到彼此中?您可以添加有关扩展和版本的标记。“自定义网格CE”好的,我想我遗漏了一个小细节,我在CEs中使用了flux。我不知道你的方法(老实说,我没有完全理解)在这种情况下有效。您也可以使用FLUIDTEMPLATE cObject呈现通量内容,但在这种情况下,直接传输变量可能更容易,因为信息已经可用,无需使用数据处理器:
loadRegister="{parentRecordType: '2'}"
10 = TEXT
10.dataWrap = My parent record is of type {register:parentRecordType}