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"
Thanks for a Solution.
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 ' '
. You may introduce this VH or use tag notation:
<f:for each="{field.referenzTeaserCategory -> dce:explode(delimiter:',')}" as="items" iteration="iterator">{items} </f:for>
BTW: really items? 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.
like this: '{field.referenzTeaserCategory -> dce:explode(delimiter:\',\')} '
Use an Partial File to solve it:
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:
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>