Assign gridelements layout template filename from DB to FLUIDTEMPLATE - upgrading from LTS 9.5 to LTS 10.4

78 views Asked by At

I was using an old version of TYPO3 (9.5). I'm upgrading to newer version 10-12.

I'm struggling with this code snippet to upgrade the TEMPLATE=file section (deprecated LTS 9.5).

I get error message "Tried resolving a template file for controller action "Standard->52" in format .html".

52 is my gridelements UID.

I was using static Gridelements (deprecated) but now I must use Gridelements w/DataProcessing.

I fetch data from tx_gridelements_backend_layout table and get filename store in database.

Old working code on 9.5

tt_content.gridelements_pi1.20.10.setup.default.columns.2 >
tt_content.gridelements_pi1.20.10.setup.default.cObject = FLUIDTEMPLATE
tt_content.gridelements_pi1.20.10.setup.default.cObject{
    partialRootPath = {$filepaths.htmlpartials}
    layoutRootPath = {$filepaths.htmllayouts}
    template = FILE
    template {
        file.stdWrap.cObject = FILES
        file.stdWrap.cObject {
            references {
                table = tx_gridelements_backend_layout
                uid.field = tx_gridelements_backend_layout
                fieldName = template
            }

            maxItems = 1

            renderObj = TEXT
            renderObj {
                data = file:current:publicUrl
            }
        }
    }
}

New code

tt_content.gridelements_pi1.20.10.setup.default.columns.2 >
tt_content.gridelements_pi1.20.10.setup.default.cObject = FLUIDTEMPLATE
tt_content.gridelements_pi1.20.10.setup.default.cObject{
    partialRootPath = {$filepaths.htmlpartials}
    layoutRootPath = {$filepaths.htmllayouts}

    file{
        stdWrap{
            cObject = FILES
            cObject {
                references {
                    table = tx_gridelements_backend_layout
                    uid.field = tx_gridelements_backend_layout
                    fieldName = template
                }

                maxItems = 1

                renderObj = TEXT
                renderObj {
                    data = file:current:publicUrl
                }
            }
            debugFunc = 1
        }
    }
}

tt_content.gridelements_view.20.10.setup.default.columns.2 >
tt_content.gridelements_view.20.10.setup.default < tt_content.gridelements_pi1.20.10.setup.default

Can anyone give me a hint

0

There are 0 answers