Skip to content

Instantly share code, notes, and snippets.

@noelboss
Created November 21, 2013 14:18
Show Gist options
  • Star 17 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save noelboss/7582267 to your computer and use it in GitHub Desktop.
Save noelboss/7582267 to your computer and use it in GitHub Desktop.
How to configure gridelements for Typo3 purely with TypoScript and TSconfig and thus living in files. Based on this article: http://www.networkteam.com/blog/post/gridelements-professionell-nutzen.html
# Page TSConfig:
tx_gridelements.setup {
# ID of Element
1 {
title = Two Columns
config {
colCount = 2
rowCount = 1
rows {
1 {
columns {
1 {
name = Left
colPos = 401
}
2 {
name = Right
colPos = 402
}
}
}
}
}
icon = EXT:nxbase/ext_icon.gif
flexformDS (
<T3DataStructure>
<meta>
<langDisable>1</langDisable>
</meta>
<ROOT type="array">
<type>array</type>
<el type="array">
<columnType type="array">
<TCEforms type="array">
<label>Column Type</label>
<config type="array">
<type>select</type>
<items type="array">
<numIndex index="0" type="array">
<numIndex index="0">1:1</numIndex>
<numIndex index="1">cols-1-1</numIndex>
</numIndex>
<numIndex index="1" type="array">
<numIndex index="0">1:2</numIndex>
<numIndex index="1">cols-1-2</numIndex>
</numIndex>
<numIndex index="2" type="array">
<numIndex index="0">2:1</numIndex>
<numIndex index="1">cols-2-1</numIndex>
</numIndex>
<numIndex index="3" type="array">
<numIndex index="0">1:3</numIndex>
<numIndex index="1">cols-1-3</numIndex>
</numIndex>
<numIndex index="4" type="array">
<numIndex index="0">3:1</numIndex>
<numIndex index="1">cols-3-1</numIndex>
</numIndex>
</items>
</config>
</TCEforms>
</columnType>
</el>
</ROOT>
</T3DataStructure>
)
}
}
# setup:
# no need to include static file anymore:
<INCLUDE_TYPOSCRIPT: source=FILE:EXT:gridelements/static/gridelements/setup.txt>
tt_content.gridelements_pi1.20.10.setup {
# Two Columns
1 < lib.gridelements.defaultGridSetup
1 {
columns {
# 401 reflects colPos
401 < .default
401 {
preCObject = CASE
preCObject {
key.field = flexform_columnType
cols-1-2 = TEXT
cols-1-2 {
value = <div class="span4">
}
cols-2-1 = TEXT
cols-2-1 {
value = <div class="span8">
}
cols-1-3 = TEXT
cols-1-3 {
value = <div class="span3">
}
cols-3-1 = TEXT
cols-3-1 {
value = <div class="span9">
}
default = TEXT
default {
value = <div class="span6">
}
}
wrap = |</div>
}
402 < .default
402 {
preCObject = CASE
preCObject {
key.field = flexform_columnType
cols-1-2 = TEXT
cols-1-2 {
value = <div class="span8">
}
cols-2-1 = TEXT
cols-2-1 {
value = <div class="span4">
}
cols-1-3 = TEXT
cols-1-3 {
value = <div class="span9">
}
cols-3-1 = TEXT
cols-3-1 {
value = <div class="span3">
}
default = TEXT
default {
value = <div class="span6">
}
}
wrap = |</div>
}
}
wrap = <div class="row">|</div>
}
}
@Bjoelin
Copy link

Bjoelin commented Sep 22, 2016

pure gold! thanks!

@georgringer
Copy link

In current versions it is btw

<INCLUDE_TYPOSCRIPT: source="FILE:EXT:gridelements/Configuration/TypoScript/setup.ts">

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment