问题
At the moment I am using this TS to prepare my content from a grid element (https://typo3.org/extensions/repository/view/gridelements):
tt_content.gridelements_pi1.20.10.setup {
1 < lib.gridelements.defaultGridSetup
1 {
columns {
10 < .default
10.wrap = <div class="gefa">|</div>
11 < .default
11.wrap = <div class="gefa2">|</div>
12 < .default
12.wrap = <div class="gefa3">|</div>
13 < .default
13.wrap = <div class="gefa4">|</div>
}
}
}
Now I want to make a html template (fluid) with placeholders for my content from the grid element. How to do this?
回答1:
You can define the rendering like a cObject.
tt_content.gridelements_pi1.20.10.setup {
1 < lib.gridelements.defaultGridSetup
1 {
cObject = FLUIDTEMPLATE
cObject {
file = path/to/your/fluid/template.html
}
}
}
in your fluid tempalte you can use the columns like this:
<div class="gefa">
<f:format.raw>
{data.tx_gridelements_view_column_10}
</f:format.raw>
</div>
<div class="gefa2">
<f:format.raw>
{data.tx_gridelements_view_column_11}
</f:format.raw>
</div>
回答2:
What TYPO3 Version do you use? On version 8.7.x I simply use these lines:
lib.gridelements.defaultGridSetup.cObject =< lib.contentElement
tt_content.gridelements_pi1.20.10.setup.{
mycontent < lib.gridelements.defaultGridSetup
mycontent.cObject.templateName = MyTemplate
}
来源:https://stackoverflow.com/questions/37286279/how-to-define-fluid-template-for-grid-elements