How to define fluid template for grid elements?

我的未来我决定 提交于 2019-12-13 05:51:13

问题


At the moment I am using this TS to prepare my content from a grid element (https://typo3.org/extensions/repository/view/gridelements):

tt_content.gridelements_pi1.20.10.setup {
  1 < lib.gridelements.defaultGridSetup
  1 {
    columns {
      10 < .default
      10.wrap = <div class="gefa">|</div>

      11 < .default
      11.wrap = <div class="gefa2">|</div>

      12 < .default
      12.wrap = <div class="gefa3">|</div>

      13 < .default
      13.wrap = <div class="gefa4">|</div>
    }
  }
}

Now I want to make a html template (fluid) with placeholders for my content from the grid element. How to do this?


回答1:


You can define the rendering like a cObject.

tt_content.gridelements_pi1.20.10.setup {
    1 < lib.gridelements.defaultGridSetup
    1 {
        cObject = FLUIDTEMPLATE
        cObject {
            file = path/to/your/fluid/template.html
        }
    }
}

in your fluid tempalte you can use the columns like this:

    <div class="gefa">
        <f:format.raw>
            {data.tx_gridelements_view_column_10}
        </f:format.raw>
    </div>
    <div class="gefa2">
        <f:format.raw>
            {data.tx_gridelements_view_column_11}
        </f:format.raw>
    </div>



回答2:


What TYPO3 Version do you use? On version 8.7.x I simply use these lines:

lib.gridelements.defaultGridSetup.cObject =<  lib.contentElement

tt_content.gridelements_pi1.20.10.setup.{
  mycontent < lib.gridelements.defaultGridSetup
  mycontent.cObject.templateName = MyTemplate
}


来源:https://stackoverflow.com/questions/37286279/how-to-define-fluid-template-for-grid-elements

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!