0
votes

Using gridelements with dataprocessing works fine for all default content elements. But if I include one of my own extension, the arguments for the controller gets lost. So the content element renders, but with the default action (list) and the default templates.


To reproduce, I used the well-known news extension:

Static includes (template):

  • news
  • gridelements
  • my_site_package

Grid rendering definition (part of "my_site_package"):

mySitePackage.gridelements.defaultGridSetup < lib.gridelements.defaultGridSetup
mySitePackage.gridelements.defaultGridSetup {
 templateName.field = tx_gridelements_backend_layout
  templateName.ifEmpty = default
  layoutRootPaths {
    10 = EXT:gridelements/Resources/Private/Layouts/
    20 = EXT:my_site_package/Resources/Private/Layouts/Gridelements/
  }
  partialRootPaths {
    10 = EXT:gridelements/Resources/Private/Partials/
    20 = EXT:my_site_package/Resources/Private/Partials/Gridelements/
  }
  templateRootPaths {
    10 = EXT:gridelements/Resources/Private/Templates/
    20 = EXT:my_site_package/Resources/Private/Templates/Gridelements/
  }
  dataProcessing {
    10 = GridElementsTeam\Gridelements\DataProcessing\GridChildrenProcessor
    10 {
        default {
            as = children
        }
    }
   }
  }

Fluid rendering (part of "my_site_package"):

<f:for each="{children}" as="row" key="rowNumber">
  <f:for each="{row}" as="column" key="columnNumber">
    <f:for each="{column}" as="child">
        <f:cObject typoscriptObjectPath="tt_content.{child.data.CType}" data="{child.data}" table="tt_content" />
    </f:for>
  </f:for>
</f:for>

Plugin integration (backend):

  • Controller action: show

Result in frontend, if NOT placed in a gridelement:

  • News plugin gets rendered correctly and calls showAction

Result in frontend, if placed in a gridelement:

  • News plugin gets rendered, but falls back to default list action. Also template settings from "my_site_package" gets ignored. Default news templates are used.

Do I miss something here or is this a bug?

2

2 Answers

1
votes

Just looked at the issue again and the solution might actually be something else:

You should disable resolveFlexformData in your Gridelements configuration, to avoid XML data being processed while rendering grid children.

https://gitlab.com/coderscare/gridelements/issues/14

0
votes

That's not a bug but a missing feature in the frontend templates that you will have to implement yourself.

Gridelements just provides some basic example templates that work with core elements out of the box. As soon as there is any plugin specific data involved, you will have to provide that data, since Gridelements can not know which plugin you are going to use and which parameters you want to provide.

Just register your own templates, partials and layouts in your sitepackage setup, so Gridelements can use them before falling back to its own files.