0

I am doing first steps with Fluid templates and grid elements in Typo3 8.7.12. So far so good I have a functioning fluid template that works just fine.

Now I wanted to integrate grid elements (first time using it).

I installed the "gridelements" extension and loaded the static template to the page template. I created some grid elements with the wizard. They are showing in the BE and I can fill them with content. All good so far.

Then I added the following to my SETUP (as found here):

tt_content.gridelements_pi1.10 =< lib.stdheader
tt_content.gridelements_pi1.20.10.setup {
  4 < lib.gridelements.defaultGridSetup
  4 {
      cObject = FLUIDTEMPLATE
      cObject {
          file = fileadmin/fluid/templates/grid_2-1-2.html
      }
   }
}

Then I added the columns (column numbers are defined correctly) in my HTML template:

<div class="col-md-6 col-xs-12">
  {data.tx_gridelements_view_column_10->f:format.raw()}
</div>
<div class="col-md-6 col-xs-12">
  {data.tx_gridelements_view_column_11->f:format.raw()}
</div>

Is there anything more to it? Template is rendered but not the content of the Grid Element CE's.

halfer
  • 19,824
  • 17
  • 99
  • 186

2 Answers2

0

Did you include the Gridelements static file containing the TypoScript setup for lib.gridelements.defaultGridSetup already? if so, when checking your setup with the TypoScript Object Browser, what is the value of the userFunc within

tt_content.gridelements_pi1.20.10.userFunc

BTW: You might want to follow the instructions in that article to get a fully Fluid based output for your Gridelements: https://coders.care/blog/tutorial/gridelements-and-cms-8/

Jo Hasenau
  • 2,526
  • 1
  • 14
  • 16
  • The userFunc value = **GridElementsTeam\Gridelements\Plugin\Gridelements->main**. I did follow Coders Care page already but also did not get me to the expected result. How exactly do I include the static file? I have the static template include in my template. – Dominik Mimra Apr 05 '18 at 18:11
  • static template should be correct. You should put an {_all} into your Fluid template to make sure the keys are correct and contain the desired values. – Jo Hasenau Apr 05 '18 at 18:30
  • I did and from what I can see it all looks ok. Stupid question: Do I have to define variables for the grid element columns as well like I do for other cObjects? – Dominik Mimra Apr 05 '18 at 18:56
  • So the keys are there in the data array and the values too, but you don't get them rendered? Could you please provide some gist, screenshot or pastebin to show what you actually got in that array? – Jo Hasenau Apr 06 '18 at 05:34
  • There are no tx_gridelements_xxx_yyy fields in that array, so nothing that could be rendered by your Fluid template, which indicates that either the userFunc has not been executed or there has been no data in these columns. So could you paste the backend layout used for that container and the TypoScript array, that you find when opening tt_content.gridelements_pi1.20.10.setup.4 in the TypoScript object browser too? – Jo Hasenau Apr 06 '18 at 07:15
  • I get several errors in the Template Analyser: https://pastebin.com/dGXZsfc8. This is the grid element (made with wizard, copied from configuration) with ID4: https://pastebin.com/KemJU0en. The object browser does not show tt_content.gridelements_pi1.20.10.setup.4. – Dominik Mimra Apr 06 '18 at 07:25
  • The container configuration looks OK so far and if it's from ID 4 it should fit the desired TypoScript configuration too. Still the problem is most likely to be found somewhere within the TypoScript configuration. Sometimes it's just missing or superfluous curly braces. Try tracing and fixing the errors with the Template Analyzer. – Jo Hasenau Apr 06 '18 at 07:41
  • No I succeeded in getting something like this in the f:debug variables dump data array: `tx_gridelements_view_column_13 => '
    – Dominik Mimra Apr 07 '18 at 05:47
  • In this case this might not be a gridelements problem, but a problem of the inline notation. Did you try using the tag based syntax {data.tx_gridelements_view_column_13} ? – Jo Hasenau Apr 09 '18 at 10:13
  • Yes, I did but did not help. This is the HTML Layout: https://pastebin.com/urYkZbMK. Results in this HTML output: https://pastebin.com/R0J0GrMW and this is the variable dump: https://pastebin.com/wmQ0jqPV. The variables in the footer get rendered properly (f1l, f1c, f1r etc.). – Dominik Mimra Apr 09 '18 at 11:46
  • I seem to have an basic understanding problem of Grid Elements. I have realized that I was actually not mapping the content of the backend layout column that contains the grid element. `main < styles.content.get main.select.where = colPos=0`. So I added `{main}` to the template. Now I get the Grid Element rendered! Yay! But what is puzzling me is that it now also "re-renders" the rest of the page **again** including what is above in the template and the grid elements only below that double content. So `{main}` renders the entire page with all objects but no content. Below are the GE's... – Dominik Mimra Apr 09 '18 at 14:05
0

I got confused with the template files. I accidentally re-rendered the entire template within the template instead of the grid element template. Thanks to Joey‘s input I finally figured it out.