Skip to content

Commit

Permalink
[FEATURE] Possibility to add icon in the middle of the divider
Browse files Browse the repository at this point in the history
  • Loading branch information
dmytro committed May 5, 2016
1 parent ad149ce commit ccf788d
Show file tree
Hide file tree
Showing 5 changed files with 89 additions and 0 deletions.
28 changes: 28 additions & 0 deletions Configuration/FlexForms/flexform_div.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<T3DataStructure>
<meta>
<langDisable>1</langDisable>
</meta>
<sheets>
<sDEF>
<ROOT>
<TCEforms>
<sheetTitle>LLL:EXT:theme_t3kit/Resources/Private/Language/ContentElements.xlf:iconTextButton.flexform.sheetGeneral</sheetTitle>
</TCEforms>
<type>array</type>
<el>
<iconClass>
<TCEforms>
<label>LLL:EXT:theme_t3kit/Resources/Private/Language/ContentElements.xlf:iconTextButton.flexform.iconClass</label>
<config>
<type>user</type>
<userFunc>T3kit\T3kitExtensionTools\UserFunction\IconFontSelector->renderField</userFunc>
<cssFile>EXT:theme_t3kit/Resources/Public/felayout_t3kit/fonts/style.css</cssFile>
<isIcoMoon>1</isIcoMoon>
</config>
</TCEforms>
</iconClass>
</el>
</ROOT>
</sDEF>
</sheets>
</T3DataStructure>
5 changes: 5 additions & 0 deletions Configuration/FluidStyledContent/Div.pagets
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
TCEFORM.tt_content.pi_flexform.div.sDEF.iconClass {
addItems {
0 = LLL:EXT:theme_t3kit/Resources/Private/Language/ContentElements.xlf:div.flexform.iconClass_none
}
}
14 changes: 14 additions & 0 deletions Configuration/FluidStyledContent/Div.setupts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
tt_content {
div =< lib.fluidContent
div {
templateName = Div

dataProcessing {
10 = T3kit\T3kitExtensionTools\DataProcessing\FlexFormProcessor
10 {
fieldName = pi_flexform
as = settings
}
}
}
}
24 changes: 24 additions & 0 deletions Configuration/TCA/Overrides/tt_content.php
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,27 @@
'
];

// "divider"
$GLOBALS['TCA']['tt_content']['types']['div'] = [
'showitem' => '
--palette--;LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:palette.general;general,
header;LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:header.ALT.div_formlabel,
tx_themes_icon,rowDescription,
--linebreak--,pi_flexform;' . $contentElementLanguageFilePrefix . 'tt_content.tabs.settings,
--div--;LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:tabs.appearance,
layout;LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:layout_formlabel,wrapper,wrapper_margin_top,
wrapper_margin_bottom,--palette--;LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:palette.appearanceLinks;appearanceLinks,
--div--;LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:tabs.access,
hidden;LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:field.default.hidden,
--palette--;LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:palette.access;access,
--div--;LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:tabs.extended,
--div--;LLL:EXT:lang/locallang_tca.xlf:sys_category.tabs.category,categories,
tx_themes_variants,tx_themes_behaviour,tx_themes_responsive,
--div--;LLL:EXT:gridelements/Resources/Private/Language/locallang_db.xlf:gridElements,
tx_gridelements_container,tx_gridelements_columns
'
];

// "accordion"
$GLOBALS['TCA']['tt_content']['types']['accordion'] = [
'showitem' => '
Expand Down Expand Up @@ -476,6 +497,9 @@
// "imageTextLink"
$GLOBALS['TCA']['tt_content']['columns']['pi_flexform']['config']['ds']['*,imageTextLink'] = 'FILE:EXT:theme_t3kit/Configuration/FlexForms/flexform_imageTextLink.xml';

// "divider"
$GLOBALS['TCA']['tt_content']['columns']['pi_flexform']['config']['ds']['*,div'] = 'FILE:EXT:theme_t3kit/Configuration/FlexForms/flexform_div.xml';

// "accordion"
$GLOBALS['TCA']['tt_content']['columns']['pi_flexform']['config']['ds']['*,accordion'] = 'FILE:EXT:theme_t3kit/Configuration/FlexForms/flexform_accordion.xml';

Expand Down
18 changes: 18 additions & 0 deletions Resources/Private/Templates/FluidStyledContent/Div.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<html xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers" data-namespace-typo3-fluid="true">
<f:layout name="ContentFooter" />

<f:section name="content">
<f:if condition="{settings.iconClass}">
<f:then>
<div class="divider">
<div class="divider__wrp">
<span class="divider__icon icons icon-{settings.iconClass}"></span>
</div>
</div>
</f:then>
<f:else>
<hr class="ce-div" />
</f:else>
</f:if>
</f:section>
</html>

0 comments on commit ccf788d

Please sign in to comment.