Skip to content

Commit

Permalink
[FEATURE] new way to add collapsible content elements (accordion) bas…
Browse files Browse the repository at this point in the history
…ed on gridelements
  • Loading branch information
pixelmatseriks committed May 11, 2016
1 parent b95a5bb commit 5951a84
Show file tree
Hide file tree
Showing 11 changed files with 290 additions and 0 deletions.
26 changes: 26 additions & 0 deletions Configuration/GridElements/FlexForms/Collapsible.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<T3DataStructure>
<meta type="array">
<langDisable>1</langDisable>
</meta>
<sheets>
<columns>
<ROOT type="array">
<TCEforms>
<sheetTitle>LLL:EXT:theme_t3kit/Resources/Private/Language/GridElements.xlf:collapsible.flexform.title</sheetTitle>
</TCEforms>
<el type="array">
<expanded>
<TCEforms>
<label>LLL:EXT:theme_t3kit/Resources/Private/Language/GridElements.xlf:collapsible.flexform.expanded</label>
<config>
<type>check</type>
<default></default>
</config>
</TCEforms>
</expanded>
</el>
</ROOT>
</columns>
</sheets>
</T3DataStructure>
20 changes: 20 additions & 0 deletions Configuration/GridElements/PageTS/Collapsible.pagets
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
tx_gridelements.setup.Collapsible {
title = LLL:EXT:theme_t3kit/Resources/Private/Language/GridElements.xlf:collapsible
description = LLL:EXT:theme_t3kit/Resources/Private/Language/GridElements.xlf:collapsible_description
flexformDS = FILE:EXT:theme_t3kit/Configuration/GridElements/FlexForms/Collapsible.xml
icon = EXT:theme_t3kit/Resources/Public/Icons/GridElements/collapsible.svg
config {
colCount = 1
rowCount = 1
rows {
1 {
columns {
1 {
name = LLL:EXT:theme_t3kit/Resources/Private/Language/GridElements.xlf:col1
colPos = 0
}
}
}
}
}
}
21 changes: 21 additions & 0 deletions Configuration/GridElements/PageTS/CollapsibleGroup.pagets
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
tx_gridelements.setup.CollapsibleGroup {
title = LLL:EXT:theme_t3kit/Resources/Private/Language/GridElements.xlf:collapsibleGroup
description = LLL:EXT:theme_t3kit/Resources/Private/Language/GridElements.xlf:collapsibleGroup_description
icon = EXT:theme_t3kit/Resources/Public/Icons/GridElements/collapsibleGroup.svg
config {
colCount = 1
rowCount = 1
rows {
1 {
columns {
1 {
name = LLL:EXT:theme_t3kit/Resources/Private/Language/GridElements.xlf:col1
colPos = 0
allowed = gridelements_pi1
allowedGridTypes = Collapsible
}
}
}
}
}
}
56 changes: 56 additions & 0 deletions Configuration/GridElements/TypoScript/Collapsible.setupts
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
lib.gridelements {
Collapsible < .defaultGridSetup
Collapsible {
columns.0 {
renderObj >
renderObj = COA
renderObj {
20 =< tt_content
}
}

cObject = FLUIDTEMPLATE
cObject {
layoutRootPaths {
20 = EXT:fluid_styled_content/Resources/Private/Layouts
30 = EXT:theme_t3kit/Resources/Private/Layouts/GridElements
}
partialRootPaths {
20 = EXT:fluid_styled_content/Resources/Private/Partials
}
file = EXT:theme_t3kit/Resources/Private/Templates/GridElements/Collapsible.html
dataProcessing {
10 = TYPO3\CMS\Frontend\DataProcessing\FilesProcessor
10 {
references.fieldName = media
}
# "inherit" from lib.fluidContent
365 < lib.fluidContent.dataProcessing.365
375 < lib.fluidContent.dataProcessing.375
385 < lib.fluidContent.dataProcessing.385
395 < lib.fluidContent.dataProcessing.395

# extend "wrapper" class mapping only for GridElements
365 {
classMappings {
11 = gridelements-example-wrapper-1
12 = gridelements-example-wrapper-2
}
}


1910 < lib.fluidContent.dataProcessing.1910

# extend "layout" class mapping only for GridElements
1910 {
classMappings {
11 = gridelements-example-layout-1
12 = gridelements-example-layout-2
}
}
}
}
}
}

tt_content.gridelements_pi1.20.10.setup.Collapsible < lib.gridelements.Collapsible
56 changes: 56 additions & 0 deletions Configuration/GridElements/TypoScript/CollapsibleGroup.setupts
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
lib.gridelements {
CollapsibleGroup < .defaultGridSetup
CollapsibleGroup {
columns.0 {
renderObj >
renderObj = COA
renderObj {
20 =< tt_content
}
}

cObject = FLUIDTEMPLATE
cObject {
layoutRootPaths {
20 = EXT:fluid_styled_content/Resources/Private/Layouts
30 = EXT:theme_t3kit/Resources/Private/Layouts/GridElements
}
partialRootPaths {
20 = EXT:fluid_styled_content/Resources/Private/Partials
}
file = EXT:theme_t3kit/Resources/Private/Templates/GridElements/CollapsibleGroup.html
dataProcessing {
10 = TYPO3\CMS\Frontend\DataProcessing\FilesProcessor
10 {
references.fieldName = media
}
# "inherit" from lib.fluidContent
365 < lib.fluidContent.dataProcessing.365
375 < lib.fluidContent.dataProcessing.375
385 < lib.fluidContent.dataProcessing.385
395 < lib.fluidContent.dataProcessing.395

# extend "wrapper" class mapping only for GridElements
365 {
classMappings {
11 = gridelements-example-wrapper-1
12 = gridelements-example-wrapper-2
}
}


1910 < lib.fluidContent.dataProcessing.1910

# extend "layout" class mapping only for GridElements
1910 {
classMappings {
11 = gridelements-example-layout-1
12 = gridelements-example-layout-2
}
}
}
}
}
}

tt_content.gridelements_pi1.20.10.setup.CollapsibleGroup < lib.gridelements.CollapsibleGroup
21 changes: 21 additions & 0 deletions Resources/Private/Language/GridElements.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,27 @@
<source>Hide in mobile</source>
</trans-unit>

<trans-unit id="collapsible">
<source>Collapsible</source>
</trans-unit>
<trans-unit id="collapsible_description">
<source>A collapsible container for content elements</source>
</trans-unit>

<trans-unit id="collapsible.flexform.title">
<source>Collapsible settings</source>
</trans-unit>
<trans-unit id="collapsible.flexform.expanded">
<source>Expanded by default</source>
</trans-unit>

<trans-unit id="collapsibleGroup">
<source>Group of collapsibles</source>
</trans-unit>
<trans-unit id="collapsibleGroup_description">
<source>A group for collapsible elements</source>
</trans-unit>

</body>
</file>
</xliff>
5 changes: 5 additions & 0 deletions Resources/Private/Layouts/GridElements/Empty.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<!-- theme_t3kit: Layouts/Empty.html [begin] -->

<f:render section="content" />

<!-- theme_t3kit: Layouts/Empty.html [end] -->
20 changes: 20 additions & 0 deletions Resources/Private/Templates/GridElements/Collapsible.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@

<f:layout name="{f:if(condition: data.tx_gridelements_container, then: 'Empty', else: 'HeaderContentFooter')}" />

<f:debug>{data}</f:debug>

<f:section name="content">
<div class="panel panel-default {layoutClass} {alignClass}">
<div class="panel-heading" role="tab" id="heading-{data.uid}">
<h4 class="panel-title">
<a data-toggle="collapse" data-parent="#group-{data.tx_gridelements_container}" href="#collapse-{data.uid}">{data.header}</a>
</h4>
</div>
<div id="collapse-{data.uid}" class="panel-collapse collapse {f:if(condition: data.pi_flexform.data.columns.lDEF.expanded.vDEF, then: 'in', else: '')}" role="tabpanel">
<div class="panel-body">
<f:format.raw>{data.tx_gridelements_view_column_0}</f:format.raw>
</div>
</div>
</div>

</f:section>
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<f:layout name="HeaderContentFooter" />

<f:debug>{data}</f:debug>

<f:section name="content">
<div class="panel-group" id="group-{f:if(condition: data._LOCALIZED_UID, then: data._LOCALIZED_UID, else: data.uid)}" role="tablist" aria-multiselectable="{f:if(condition: '{data.pi_flexform.data.columns.lDEF.multiselectable.vDEF}', then: 'true', else: 'false')}">
<f:format.raw>{data.tx_gridelements_view_column_0}</f:format.raw>
</div>
</f:section>
28 changes: 28 additions & 0 deletions Resources/Public/Icons/GridElements/collapsible.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
28 changes: 28 additions & 0 deletions Resources/Public/Icons/GridElements/collapsibleGroup.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 5951a84

Please sign in to comment.