网格元素的所有配置仅在文件中



我想在文件中包含网格元素的所有配置。因此,当我将CE后端布局存储在后端时,它可以正常工作

mod.web_layout.BackendLayouts {
  exampleKey {
    title = Example
    icon = EXT:my_ext/Gridelements/Teaser/Resources/Public/Icons/icon.gif
    config {
      backend_layout {
        colCount = 1
        rowCount = 1
        rows {
          1 {
            columns {
              1 {
                name = Content
                colPos = 0
              }
            }
          }
        }
      }
    }
  }
}

但是如果我在TSConfig中设置配置,内容不会渲染。

tx_gridelements {
  overruleRecords = 1
  setup {
    2-Teaser {
      title = Teaser
      description = Teaser
      icon = EXT:my_ext/Gridelements/Teaser/Resources/Public/Icons/icon.gif
      topLevelLayout = 0
      config {
        colCount = 1
        rowCount = 1
        rows {
          1 {
            columns {
              1 {
                name = Content
                colPos = 0
              }
            }
          }
        }
      }
    }
  }
}

网格元素找到此模板,但没有呈现内容

tt_content.gridelements_pi1.20.10.setup {
  1 < lib.gridelements.defaultGridSetup
  1 {
    cObject = FLUIDTEMPLATE
    cObject.file = EXT:my_ext/Gridelements/Teaser/Resources/Private/Templates/Template.html
  }
}
有点

晚了,但我在gridelementsTYPO3 8.7 LTS方面遇到了同样的问题 - 尤其是像你一样的文件配置。我从文件系统中的CE BackendLayouts复制了源代码,这是我的错。这是正确的代码:

佩奇TS

tx_gridelements {
    setup {
      SectionColoured {
        title = LLL:EXT:yourext/Resources/Private/Language/...
        description = LLL:EXT:yourext/Resources/Private/Language/...
        # optional #icon = EXT:yourext/Resources/Public/Images/...
        # optional # flexformDS = FILE:EXT:yourext/Configuration/FlexForms/Gridelements/SectionColoured.xml
        config {
            colCount = 1
            rowCount = 1
            rows {
              1 {
                columns {
                  1 {
                    name = LLL:EXT:yourext/Resources/Private/Language/...
                    colPos = 101
                  }
                }
              }
            }
        }
      } 
   }
}

TS

// loaded ts after install the ext:gridelements
[userFunc = TYPO3CMSCoreUtilityExtensionManagementUtility::isLoaded('gridelements')]
    <INCLUDE_TYPOSCRIPT: source="FILE:EXT:gridelements/Configuration/TypoScript/setup.ts" extensions="ts">
[global]
tt_content.gridelements_pi1 =< lib.contentElement
    tt_content.gridelements_pi1 {
    templateName = Generic
    variables {
        content =< tt_content.gridelements_view
    }
}
tt_content {
    gridelements_pi1 = COA
    gridelements_pi1 {
        20 {
            10 {
                setup {
                    SectionColoured < lib.gridelements.defaultGridSetup
                    SectionColoured {
                        cObject = FLUIDTEMPLATE
                        cObject {
                            file = EXT:yourext/Resources/Private/Extensions/Gridelements/SectionColoured.html
                        }
                    }
                }
            }
        }
    }
}
tt_content.gridelements_view < tt_content.gridelements_pi1

和网格元素模板文件在: EXT:yourext/Resources/Private/Extensions/Gridelements/SectionColoured.html

<section class="main-content {data.flexform_colour}">
    <article>
        <f:format.raw>{data.tx_gridelements_view_columns.101}</f:format.raw>
    </article>
</section>

现在它工作了!

由于后端布局不是 1 而是 2-Teaser,因此您的 TypoScript 设置必须与该标识符匹配:

tt_content.gridelements_pi1.20.10.setup {
  2-Teaser < lib.gridelements.defaultGridSetup
  2-Teaser {
    cObject = FLUIDTEMPLATE
    cObject.file = EXT:my_ext/Gridelements/Teaser/Resources/Private/Templates/Template.html
  }
}

最新更新