首页 > 解决方案 > TYPO3 10.4 / FLUIDTEMPLATE / renderObj / 图像

问题描述

我有一个简单的模板,它显示了“页面”的“content_icon”的全部内容——到目前为止一切都很好。

现在我只想添加“content_icon”中的图像 - 没办法。

这是 (ext+) 模板:

<f:section name="main">
  <f:format.htmlentitiesDecode>{content_icon}</f:format.htmlentitiesDecode>
  <p>-----------------------------</p>
  <p>
    <f:cObject typoscriptObjectPath="SliderElement.10.variables.icon"/>
  </p>
  <p>{icon}</p>
</f:section>

我已经尝试过这个(以及更多) https://docs.typo3.org/m/typo3/reference-typoscript/master/en-us/ContentObjects/Files/Index.html#usage-with-references但是->根本没有输出。

我发现,如果我添加以下作业,似乎任何东西都被读取了......我得到一个输出 - 但没有图像......

page_id < styles.content.get

现在使用 TYPO3 10.4 扩展(模板)挣扎了 3 天。没有看到任何光亮。

  SliderElement = PAGE
  SliderElement.10 = FLUIDTEMPLATE
  SliderElement.10 {
   format = html
   file = fileadmin/site_elements/Templates/SliderElement.html
   partialRootPath = fileadmin/site_elements/Partials/
   layoutRootPath = fileadmin/site_elements/Layouts/
   variables {
     page_id = FILE
     page_id < styles.content.get
     page_id.select.where = "tt_content"."colPos" = 20
     page_id {
       stdWrap.wrap = <div class="pic">|</div>
       references {
         uid.data = uid
         #fieldName = image // try
         #fieldName = media // try
         fieldName = assets
       }
       renderObj = IMAGE
       renderObj {
         file {
           import.data = file:current:uid
           treatIdAsReference = 1
         }
         altText.data = file:current:alternative
         stdWrap.typolink.parameter.data = file:current:link
       }
     }

      content_icon < styles.content.get
      content_icon.select.where = "tt_content"."colPos" = 20
   }
}

任何帮助或想法都会很好......

标签: imagetypo3content-management-systemtyposcripttypo3-10.x

解决方案


推荐阅读