CodersCare / gridelements

Be part of the future of TYPO3! Support Gridelements now and unlock exclusive early access to v13! The well-established Gridelements V12 elevates TYPO3 by bringing grid-based layouts to content elements, with powerful features like advanced drag & drop and real references. Supercharge your workflow and make daily tasks easier. Sponsor us here:
https://coders.care/for/crowdfunding/gridelements
GNU General Public License v3.0
5 stars 25 forks source link

no rendering of gridelements in backend #29

Closed dspenner closed 1 year ago

dspenner commented 1 year ago

Since upgrading gridelements to version 11, the elements of the grids are no longer rendered.

grafik

Code Page.ts

lib.gridelements.defaultGridSetup {
  columns {
    default {
      renderObj = COA
      renderObj {
        20 =< tt_content
      }
    }
  }
  cObject =< lib.contentElement
  cObject.templateName = Generic
}

tt_content.gridelements_pi1.20.10.setup {
  5 < lib.gridelements.defaultGridSetup
  5 {
      cObject = FLUIDTEMPLATE
      cObject {
        file = EXT:my_template/Resources/Private/Gridelements/col-50-50.html
      }
  }
}

HTML Code:

<div class="FlexContainer">
    <div class="col1 col-50-50 Border">
            <!-- {data.tx_gridelements_view_column_89->f:format.raw()} -->
      <f:format.raw>{data.tx_gridelements_view_column_89}</f:format.raw>
        </div>

        <div class="col2 col-50-50 Border">
            <!-- {data.tx_gridelements_view_column_88->f:format.raw()}       -->
      <f:format.raw>{data.tx_gridelements_view_column_88}</f:format.raw>
        </div>
</div>

Backend Layout Page TS

mod.web_layout.BackendLayouts {
  exampleKey {
    title = Example
    icon = EXT:example_extension/Resources/Public/Images/BackendLayouts/default.gif
    config {
      backend_layout {
        colCount = 2
        rowCount = 1
        rows {
          1 {
            columns {
              1 {
                name = 50%
                colPos = 89
              }
              2 {
                name = 50%
                colPos = 88
              }
            }
          }
        }
      }
    }
  }
}
Bunnyfield commented 1 year ago

The screen shot looks as if there are no child elements connected anymore - so you most likely did a Database-MIgration with Gridelements uninstalled, which breaks the colPos field definition and results in colPos 0 instead of -1.

If so, there is a new scheduler task with Gridelements 11, that can help you to get back the broken values.

dspenner commented 1 year ago

I don't know that I have done a database migration.

grafik

Where can I find the task?

Bunnyfield commented 1 year ago

You can check, if the DB values are the problem by looking at one of the child elements. If it has got a colPos value of 0, that's most likely due to the Database-Analyse step of the Install-Tool.

The task to fix this can be found in the scheduler - just go there and create a new task, then pick the necessary task from the list of Gridelements tasks. After saving it, you can run it by clicking on the play button.

dspenner commented 1 year ago

Do you mean this value? grafik

After executing the task in the scheduler, everything works again.

Bunnyfield commented 1 year ago

OK - if those values are actually correct, the next option is a missing information about the container structure, that leads to the missing rendering of the preview,

mod.web_layout.BackendLayouts

seems to be wrong, so are you sure, this is the configuration for your container?

dspenner commented 1 year ago

Yes, this is the configuration. The configuration was created by the wizard.

But after executing the task in the scheduler, everything works again.

Bunnyfield commented 1 year ago

Thanks for the feedback.

Just for the record: While upgrading form TYPO3 CMS 10 to 11 there is no need to uninstall Gridelements, since you can already upgrade Gridelements before the actual core upgrade, because it is comptaible to both CMS 10 and 11.

If you still upgrade the core with uninstalled extensions, you have to make sure to not touch the colPos field of tt_content at all. So you have to manually uncheck the box in the Database Analyser before executing the update.

See: https://docs.typo3.org/p/gridelementsteam/gridelements/main/en-us/Chapters/Notes/Index.html