Skip to content

Instantly share code, notes, and snippets.

@Merec
Last active November 29, 2021 07:14

Revisions

  1. Merec revised this gist Oct 20, 2013. 1 changed file with 0 additions and 1 deletion.
    1 change: 0 additions & 1 deletion setup.txt
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,3 @@

    # First define the tab cObject, we want this in the container
    tt_content.gridelements_pi1.20.10.setup.uebb_bootstrap_tabs_tab {

  2. Merec revised this gist Oct 20, 2013. 1 changed file with 19 additions and 24 deletions.
    43 changes: 19 additions & 24 deletions setup.txt
    Original file line number Diff line number Diff line change
    @@ -1,19 +1,8 @@
    plugin.tx_gridelements_pi1.setup.uebb_bootstrap_tabs_container {
    # Render the children with default settings
    columns < lib.gridelements.defaultGridSetup.columns

    # Render navigation using fluid
    cObject = FLUIDTEMPLATE
    cObject {
    file = fileadmin/templates/gridelements/bootstrap3_tabs/bootstrap3_tabs_template.html
    }
    }
    # First define the tab cObject, we want this in the container
    tt_content.gridelements_pi1.20.10.setup.uebb_bootstrap_tabs_tab {

    plugin.tx_gridelements_pi1.setup.uebb_bootstrap_tabs_tab {
    # Render the children with default settings
    columns < lib.gridelements.defaultGridSetup.columns

    # Render the parent
    # Add the ID and the Class to the tab container
    preCObject = LOAD_REGISTER
    preCObject {
    containerId.cObject = COA
    @@ -47,17 +36,23 @@ plugin.tx_gridelements_pi1.setup.uebb_bootstrap_tabs_tab {

    outerWrap = <div {register: containerId} {register: containerClasses}>|</div>
    outerWrap.insertData = 1
    }

    # Append setup to gridelements
    tt_content.gridelements_pi1.20.10.setup {
    uebb_bootstrap_tabs_container < plugin.tx_gridelements_pi1.setup.uebb_bootstrap_tabs_container
    uebb_bootstrap_tabs_tab < plugin.tx_gridelements_pi1.setup.uebb_bootstrap_tabs_tab
    # Render the children the default way
    columns.0 {
    renderObj = < tt_content
    }
    }

    # We want to remove the wrap around the gridelements "uebb_bootstrap_tabs_tab" (<div id="cX" class="csc-default">)
    tt_content.stdWrap.innerWrap.cObject.default.if {
    isInList.field = tx_gridelements_backend_layout
    value = uebb_bootstrap_tabs_tab
    negate = 1
    # Define the Tab Container
    tt_content.gridelements_pi1.20.10.setup.uebb_bootstrap_tabs_container {
    # Render navigation using fluid
    cObject = FLUIDTEMPLATE
    cObject {
    file = fileadmin/templates/gridelements/bootstrap3_tabs/bootstrap3_tabs_template.html
    }

    # Add the renderObj of the tab directly, this prevents the "csc-default"-wrap
    columns.0 {
    renderObj = < tt_content.gridelements_pi1
    }
    }
  3. Merec revised this gist Oct 19, 2013. 1 changed file with 8 additions and 20 deletions.
    28 changes: 8 additions & 20 deletions setup.txt
    Original file line number Diff line number Diff line change
    @@ -33,27 +33,15 @@ plugin.tx_gridelements_pi1.setup.uebb_bootstrap_tabs_tab {
    10.field = parentgrid_flexform_switch_effect
    10.noTrimWrap = | | |

    # We want the active flag in the first child
    20 = LOAD_REGISTER
    20 {
    childCounter.cObject = TEXT
    childCounter.cObject {
    data = register:childCounterValue
    wrap = |+1
    }
    childCounterValue.cObject = TEXT
    childCounterValue.cObject {
    data = register:childCounter
    prioriCalc = intval
    }
    # We want the active flag on the first child
    20 = TEXT
    20.value = active in
    20.noTrimWrap = | | |
    20.if {
    value = 1
    equals.data = cObj:parentRecordNumber
    equals.prioriCalc = 1
    }

    # only set if register is 1
    21 = TEXT
    21.value = active in
    21.noTrimWrap = | | |
    21.if.value.data = register:childCounterValue
    21.if.equals = 1
    }
    }

  4. Merec revised this gist Oct 19, 2013. 3 changed files with 1 addition and 3 deletions.
    2 changes: 1 addition & 1 deletion bootstrap3_tabs_template.html
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,5 @@
    <ul class="nav {data.flexform_display_type}">
    <f:for each="{data.tx_gridelements_view_children}" as="tab" iteration="tab_iteration">
    <f:for each="{data.tx_gridelements_view_children}" as="tab" iteration="tab_iteration">
    <li{f:if(condition:'{tab_iteration.isFirst}',then:' class="active"')}><a href="#tab-content-{tab.uid}" data-toggle="tab">{tab.header}</a></li>
    </f:for>
    </ul>
    1 change: 0 additions & 1 deletion page_ts.txt
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,3 @@

    # Tabs Container
    tx_gridelements.setup.uebb_bootstrap_tabs_container {
    title = Tabs Container
    1 change: 0 additions & 1 deletion setup.txt
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,3 @@

    plugin.tx_gridelements_pi1.setup.uebb_bootstrap_tabs_container {
    # Render the children with default settings
    columns < lib.gridelements.defaultGridSetup.columns
  5. Merec created this gist Oct 19, 2013.
    43 changes: 43 additions & 0 deletions bootstrap3_tabs_container.xml
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,43 @@
    <?xml version="1.0" encoding="utf-8" standalone="yes" ?>
    <T3DataStructure>
    <meta type="array">
    <langDisable>1</langDisable>
    </meta>
    <sheets>
    <general>
    <ROOT type="array">
    <TCEforms>
    <sheetTitle>Einstellungen</sheetTitle>
    </TCEforms>
    <el type="array">
    <display_type type="array">
    <TCEforms type="array">
    <label>Aussehen</label>
    <config type="array">
    <type>select</type>
    <items type="array">
    <numIndex index="0" type="array"><numIndex index="0">Tabs</numIndex><numIndex index="1">nav-tabs</numIndex></numIndex>
    <numIndex index="1" type="array"><numIndex index="0">Pills</numIndex><numIndex index="1">nav-pills</numIndex></numIndex>
    </items>
    <default>nav-tabs</default>
    </config>
    </TCEforms>
    </display_type>
    <switch_effect type="array">
    <TCEforms type="array">
    <label>Switch effekt</label>
    <config type="array">
    <type>select</type>
    <items type="array">
    <numIndex index="0" type="array"><numIndex index="0">Ohne</numIndex><numIndex index="1"></numIndex></numIndex>
    <numIndex index="1" type="array"><numIndex index="0">Einblenden</numIndex><numIndex index="1">fade</numIndex></numIndex>
    </items>
    <default></default>
    </config>
    </TCEforms>
    </switch_effect>
    </el>
    </ROOT>
    </general>
    </sheets>
    </T3DataStructure>
    9 changes: 9 additions & 0 deletions bootstrap3_tabs_template.html
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,9 @@
    <ul class="nav {data.flexform_display_type}">
    <f:for each="{data.tx_gridelements_view_children}" as="tab" iteration="tab_iteration">
    <li{f:if(condition:'{tab_iteration.isFirst}',then:' class="active"')}><a href="#tab-content-{tab.uid}" data-toggle="tab">{tab.header}</a></li>
    </f:for>
    </ul>

    <div class="tab-content">
    <f:format.raw>{data.tx_gridelements_view_columns.0}</f:format.raw>
    </div>
    46 changes: 46 additions & 0 deletions page_ts.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,46 @@

    # Tabs Container
    tx_gridelements.setup.uebb_bootstrap_tabs_container {
    title = Tabs Container
    description = Ein Element das mehrere Tabs enthält
    flexformDS = FILE:fileadmin/templates/gridelements/bootstrap3_tabs/bootstrap3_tabs_container.xml

    config {
    colCount = 1
    rowCount = 1

    rows {
    1 {
    columns {
    1 {
    name = Tab Container Element
    colPos = 0
    allowed = gridelements_pi1
    }
    }
    }
    }
    }
    }

    # Tab Element
    tx_gridelements.setup.uebb_bootstrap_tabs_tab {
    title = Tab
    description = Ein Tab für einen Tab-Container

    config {
    colCount = 1
    rowCount = 1

    rows {
    1 {
    columns {
    1 {
    name = Tab Element
    colPos = 0
    }
    }
    }
    }
    }
    }
    76 changes: 76 additions & 0 deletions setup.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,76 @@

    plugin.tx_gridelements_pi1.setup.uebb_bootstrap_tabs_container {
    # Render the children with default settings
    columns < lib.gridelements.defaultGridSetup.columns

    # Render navigation using fluid
    cObject = FLUIDTEMPLATE
    cObject {
    file = fileadmin/templates/gridelements/bootstrap3_tabs/bootstrap3_tabs_template.html
    }
    }

    plugin.tx_gridelements_pi1.setup.uebb_bootstrap_tabs_tab {
    # Render the children with default settings
    columns < lib.gridelements.defaultGridSetup.columns

    # Render the parent
    preCObject = LOAD_REGISTER
    preCObject {
    containerId.cObject = COA
    containerId.cObject {
    wrap = id="|"
    10 = TEXT
    10.wrap = tab-content-|
    10.field = uid
    }

    containerClasses.cObject = COA
    containerClasses.cObject {
    wrap = class="tab-pane |"

    # fade or empty
    10 = TEXT
    10.field = parentgrid_flexform_switch_effect
    10.noTrimWrap = | | |

    # We want the active flag in the first child
    20 = LOAD_REGISTER
    20 {
    childCounter.cObject = TEXT
    childCounter.cObject {
    data = register:childCounterValue
    wrap = |+1
    }
    childCounterValue.cObject = TEXT
    childCounterValue.cObject {
    data = register:childCounter
    prioriCalc = intval
    }
    }

    # only set if register is 1
    21 = TEXT
    21.value = active in
    21.noTrimWrap = | | |
    21.if.value.data = register:childCounterValue
    21.if.equals = 1
    }
    }

    outerWrap = <div {register: containerId} {register: containerClasses}>|</div>
    outerWrap.insertData = 1
    }

    # Append setup to gridelements
    tt_content.gridelements_pi1.20.10.setup {
    uebb_bootstrap_tabs_container < plugin.tx_gridelements_pi1.setup.uebb_bootstrap_tabs_container
    uebb_bootstrap_tabs_tab < plugin.tx_gridelements_pi1.setup.uebb_bootstrap_tabs_tab
    }

    # We want to remove the wrap around the gridelements "uebb_bootstrap_tabs_tab" (<div id="cX" class="csc-default">)
    tt_content.stdWrap.innerWrap.cObject.default.if {
    isInList.field = tx_gridelements_backend_layout
    value = uebb_bootstrap_tabs_tab
    negate = 1
    }