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
Php 类型3 7.4。通过打字脚本获取tt_内容文本媒体图像_Php_Typo3_Typoscript_Typo3 7.x - Fatal编程技术网

Php 类型3 7.4。通过打字脚本获取tt_内容文本媒体图像

Php 类型3 7.4。通过打字脚本获取tt_内容文本媒体图像,php,typo3,typoscript,typo3-7.x,Php,Typo3,Typoscript,Typo3 7.x,我正在创建一个新页面,并尝试在后端使页脚可编辑。因此,我创建了一个新的tt_content textmedia元素,并通过打字脚本将其保存到一个变量: footerdata = RECORDS footerdata { tables = tt_content source = 165 dontCheckPid = 1 conf.tt_content = COA conf.tt_content { 10 = TEXT 10.field = header

我正在创建一个新页面,并尝试在后端使页脚可编辑。因此,我创建了一个新的tt_content textmedia元素,并通过打字脚本将其保存到一个变量:

footerdata = RECORDS
footerdata {
  tables = tt_content
  source = 165
  dontCheckPid = 1
  conf.tt_content = COA
  conf.tt_content {
    10 = TEXT
    10.field = header
    10.wrap = <h1>|</h1>

    20 = TEXT
    20.field = bodytext
    20.parseFunc =< lib.parseFunc_RTE
    20.wrap = <div>|</div>
  }
}
在我的模板中,我只需将以下内容添加到页脚:

<f:format.raw>{footerdata}</f:format.raw>
这对标题和文本很有效,但我就是不知道如何对图像也这样做。任何人有任何教程,链接等,我可以在哪里找到这个?我试图用谷歌搜索这个问题,但Typo37似乎是一个新的有任何可行的提示可用


提前谢谢

我不太喜欢记录对象;我总觉得这很神秘

我通常将这些条目放在一个sysfolder中,然后获取该pid的所有内容

老派做法:

下面是一个示例,我将如何使用流体模板渲染该对象,完全可以选择使用VHS viewhelper扩展插件EXT:VHS

{namespace v=FluidTYPO3\Vhs\ViewHelpers}

<div class="small-12 medium-6 large-4 columns">
    <f:for each="{files}" as="file">
        <v:media.image src="{file}" srcset="1200,900,600" srcsetDefault="600" alt="{file.alternative}" treatIdAsReference="1"/>
    </f:for>
    <h1>{data.header}</h1>
    <div>{data.bodytext}</div>
</div>

<f:comment>
// memory help for debugging:
<f:debug>{data}</f:debug>
<f:debug>{settings}</f:debug>
<f:debug>{file}</f:debug>
</f:comment>
更准确地说,renderObj应替换为。不过我还没准备好


我不太喜欢记录对象;我总觉得这很神秘

我通常将这些条目放在一个sysfolder中,然后获取该pid的所有内容

老派做法:

下面是一个示例,我将如何使用流体模板渲染该对象,完全可以选择使用VHS viewhelper扩展插件EXT:VHS

{namespace v=FluidTYPO3\Vhs\ViewHelpers}

<div class="small-12 medium-6 large-4 columns">
    <f:for each="{files}" as="file">
        <v:media.image src="{file}" srcset="1200,900,600" srcsetDefault="600" alt="{file.alternative}" treatIdAsReference="1"/>
    </f:for>
    <h1>{data.header}</h1>
    <div>{data.bodytext}</div>
</div>

<f:comment>
// memory help for debugging:
<f:debug>{data}</f:debug>
<f:debug>{settings}</f:debug>
<f:debug>{file}</f:debug>
</f:comment>
更准确地说,renderObj应替换为。不过我还没准备好


另一种方法是使用VHS扩展并使用render.record viewhelper:


另一种方法是使用VHS扩展并使用render.record viewhelper:


很好,我以前没见过那个!真的吗?VHS是一个装满小宝石的盒子。没有这个扩展就不能建立一个网站。是的,把它们都收集起来:-我是说v:render.record。顺便问一下:您是否使用带有srcset属性的v:media.image来替换fluid\u styled\u content MediaGallery.html模板中的f:media?我尝试在那里应用它,因为我想要srcset,但没有lucknice,以前从未见过它!真的吗?VHS是一个装满小宝石的盒子。没有这个扩展就不能建立一个网站。是的,把它们都收集起来:-我是说v:render.record。顺便问一下:您是否使用带有srcset属性的v:media.image来替换fluid\u styled\u content MediaGallery.html模板中的f:media?我尝试在那里应用它,因为我想要srcset,但没有运气
lib.address = CONTENT
lib.address {
  # same as above
  wrap = |
  table = tt_content
  select.languageField = sys_language_uid

  # here it's getting different
  renderObj = FLUIDTEMPLATE
  renderObj {
    file = {$customContentTemplatePath}/MyFile.html
    layoutRootPath = {$customContentLayoutPath}
    partialRootPath = {$customContentPartialPath}
    dataProcessing {
      // https://docs.typo3.org/typo3cms/TyposcriptReference/ContentObjects/Fluidtemplate/Index.html
      // available data processors: SplitProcessor, CommaSeparatedValueProcessor, FilesProcessor, DatabaseQueryProcessor, GalleryProcessor
      10 = TYPO3\CMS\Frontend\DataProcessing\FilesProcessor
      10.references.fieldName = image
    }
    //settings {
    // type = some_setting
    //}
  }
}
{namespace v=FluidTYPO3\Vhs\ViewHelpers}

<div class="small-12 medium-6 large-4 columns">
    <f:for each="{files}" as="file">
        <v:media.image src="{file}" srcset="1200,900,600" srcsetDefault="600" alt="{file.alternative}" treatIdAsReference="1"/>
    </f:for>
    <h1>{data.header}</h1>
    <div>{data.bodytext}</div>
</div>

<f:comment>
// memory help for debugging:
<f:debug>{data}</f:debug>
<f:debug>{settings}</f:debug>
<f:debug>{file}</f:debug>
</f:comment>