[TYPO3-dev] Render array of TypoScript content/objects as FLUIDTEMPLATE

Wouter Beeftink wouter at roquin.nl
Wed Nov 6 07:12:05 CET 2013


Hi guys,

I was wondering if anyone here knows if there's a way to render an array of TypoScript content/objects as a FLUIDTEMPLATE? What I would like to achieve is something like this:

TypoScript:

temp.myObj= CONTENT
temp.myObj{
table = pages
select {
pidInList = 1
}
???
}

Fluid template:

<ul>
<f:for each="{pages}" as="page">
<li>{page.title}</li>
</f:for>
</ul>

I hope the example makes sense. Especially since the forum lacks syntax highlighting or any way to add indents afaik.

This is a pretty common use case. We use TypoScript to retrieve records all the time and normally the renderObj would be a TEXT object or a COA containing the HTML needed to render the output. Now we're trying to move most of the HTML to fluid templates

What I've gotten so far is the following example:

temp.myObj = CONTENT
temp.myObj {
                
table = pages
select {
..
}

wrap.stdWrap.cObject = FLUIDTEMPLATE
wrap.stdWrap.cObject {
..
}

renderObj = FLUIDTEMPLATE
renderObj {
..
}
}

This is better than having HTML mixed with TypoScript (imo) but it requires two seperate templates. One for rendering the "wrap", and one for rendering each "renderObj".

Also interesting: I came across this bug report from 3 years ago by Stefan Frömken, which can be found here: //forge.typo3.org/issues/23853 (am not allowed to posts links yet). The thing he's trying to achieve seems similar to what I'm trying. Oddly, this ticket seems to has led to the addition of FLUIDTEMPLATE settings. Something that doesn't help what he's trying to achieve if I understand it correctly.

Any help is appreciated. This would greatly improve the seperation of HTML from TypoScript.

Kind regards,

Wouter



More information about the TYPO3-dev mailing list