简体   繁体   English

TYPO3-内联流体-添加空格

[英]TYPO3 - inline FLUID - add a Space

I am searching for a Example or Solution. 我在寻找示例或解决方案。 I have a inline for each and I need a Space after the Items 我每个人都有一个内联,项目后需要一个空格

{items -> f:for(each: '{field.referenzTeaserCategory -> dce:explode(delimiter:\',\')}', as: 'items', iteration: 'iterator')}

The Output is "cat1cat2cat3" but i need the Output with a Space, like this: "cat1 cat2 cat3" 输出为“ cat1cat2cat3”,但我需要带空格的输出,例如:“ cat1 cat2 cat3”

Thanks for a Solution. 感谢您的解决方案。

Use an Partial File to solve it: 使用部分文件来解决它:

MyPartial.html MyPartial.html

<f:spaceless>
  <f:for each="{field.referenzTeaserCategory -> dce:explode(delimiter:',')}" as="item" iteration="iterator">
    {item}
  </f:for>
</f:spaceless>

You can also use Sections within your template: 您还可以在模板中使用Sections:

MyTemplate.html MyTemplate.html

<div class="{f:render(section:'myCategories', arguments:_all)}"></div>

<f:section name="MyCategories"><f:spaceless>
  <f:for each="{field.referenzTeaserCategory -> dce:explode(delimiter:',')}" as="item" iteration="iterator">
    {item}
  </f:for>
</f:spaceless></f:section>

I don't think that you can build this with inline notation with normal fluid. 我认为您不能使用带有普通流体的内联符号构建此代码。
You need to use a viewhelper which concatenates your variable items with a string ' ' . 您需要使用viewhelper将变量items与字符串' '连接在一起。 You may introduce this VH or use tag notation: 您可以引入此VH或使用标记符号:

<f:for each="{field.referenzTeaserCategory -> dce:explode(delimiter:',')}" as="items" iteration="iterator">{items} </f:for>

BTW: really item s ? 顺便说一句:真的项目s吗? it is only one item (at a time) 一次只有一项

Haven't used an inline foreach yet but maybe an whitespapce after the closing curly bracket will work. 尚未使用内联foreach,但在大括号后可以使用空格。

like this: '{field.referenzTeaserCategory -> dce:explode(delimiter:\\',\\')} ' 像这样: '{field.referenzTeaserCategory -> dce:explode(delimiter:\\',\\')} '

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM