Skip to content

Commit

Permalink
[FEATURE] add possibility to show link as a btn and btn as a link
Browse files Browse the repository at this point in the history
  • Loading branch information
dmytro committed May 4, 2016
1 parent 870c3c8 commit ad149ce
Show file tree
Hide file tree
Showing 8 changed files with 56 additions and 3 deletions.
8 changes: 8 additions & 0 deletions Configuration/FlexForms/flexform_bigIconTextButton.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,14 @@
</TCEforms>
<type>array</type>
<el>
<btnAsLink>
<TCEforms>
<label>LLL:EXT:theme_t3kit/Resources/Private/Language/ContentElements.xlf:elem.flexform.btnAsLink</label>
<config>
<type>check</type>
</config>
</TCEforms>
</btnAsLink>
<iconClass>
<TCEforms>
<label>LLL:EXT:theme_t3kit/Resources/Private/Language/ContentElements.xlf:bigIconTextButton.flexform.iconClass</label>
Expand Down
8 changes: 8 additions & 0 deletions Configuration/FlexForms/flexform_iconTextButton.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,14 @@
</TCEforms>
<type>array</type>
<el>
<btnAsLink>
<TCEforms>
<label>LLL:EXT:theme_t3kit/Resources/Private/Language/ContentElements.xlf:elem.flexform.btnAsLink</label>
<config>
<type>check</type>
</config>
</TCEforms>
</btnAsLink>
<iconClass>
<TCEforms>
<label>LLL:EXT:theme_t3kit/Resources/Private/Language/ContentElements.xlf:iconTextButton.flexform.iconClass</label>
Expand Down
25 changes: 25 additions & 0 deletions Configuration/FlexForms/flexform_imageTextLink.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<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>
<linkAsBtn>
<TCEforms>
<label>LLL:EXT:theme_t3kit/Resources/Private/Language/ContentElements.xlf:elem.flexform.linkAsBtn</label>
<config>
<type>check</type>
</config>
</TCEforms>
</linkAsBtn>
</el>
</ROOT>
</sDEF>
</sheets>
</T3DataStructure>
4 changes: 4 additions & 0 deletions Configuration/TCA/Overrides/tt_content.php
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,7 @@
--linebreak--,bodytext;' . $contentElementLanguageFilePrefix . 'imageTextLink.bodytext,
--linebreak--,subheader;' . $contentElementLanguageFilePrefix . 'imageTextLink.linkText,
--linebreak--,header_link;' . $cmsLanguageFilePrefix . 'header_link_formlabel,
--linebreak--,pi_flexform;' . $contentElementLanguageFilePrefix . 'tt_content.tabs.settings,
--div--;' . $frontendLanguageFilePrefix . 'tabs.images,image,
--div--;' . $contentElementLanguageFilePrefix . 'imageTextLink.tabs.media,media,
--div--;' . $frontendLanguageFilePrefix . 'tabs.appearance,
Expand Down Expand Up @@ -472,6 +473,9 @@
// "iconTextButton"
$GLOBALS['TCA']['tt_content']['columns']['pi_flexform']['config']['ds']['*,iconTextButton'] = 'FILE:EXT:theme_t3kit/Configuration/FlexForms/flexform_iconTextButton.xml';

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

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

Expand Down
8 changes: 8 additions & 0 deletions Resources/Private/Language/ContentElements.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,14 @@
<trans-unit id="label.default">
<source>Default</source>
</trans-unit>


<trans-unit id="elem.flexform.linkAsBtn">
<source>Show link as a button</source>
</trans-unit>
<trans-unit id="elem.flexform.btnAsLink">
<source>Show button as a link</source>
</trans-unit>
</body>
</file>
</xliff>
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ <h3 class="big-icon-text-btn__header">{data.header}</h3>
<p class="big-icon-text-btn__p">{data.bodytext}</p>
</f:if>
<f:if condition="{data.header_link}">
<f:link.typolink parameter="{data.header_link}" class="big-icon-text-btn__link btn btn-default">{data.subheader}</f:link.typolink>
<f:link.typolink parameter="{data.header_link}" class="big-icon-text-btn__link {f:if(condition: settings.btnAsLink, then: '', else: 'btn btn-default')}">{data.subheader}</f:link.typolink>
</f:if>
</div>
<!-- theme_t3kit: Templates/ContentElements/bigIconTextButton.html [end] -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ <h3 class="icon-text-btn__header">
<p class="icon-text-btn__p">{data.bodytext}</p>
</f:if>
<f:if condition="{data.header_link}">
<f:link.typolink parameter="{data.header_link}" title="{data.subheader}" class="icon-text-btn__link btn btn-default">{data.subheader}</f:link.typolink>
<f:link.typolink parameter="{data.header_link}" title="{data.subheader}" class="icon-text-btn__link {f:if(condition: settings.btnAsLink, then: '', else: 'btn btn-default')}">{data.subheader}</f:link.typolink>
</f:if>
</div>
<!-- theme_t3kit: Templates/ContentElements/IconTextButton.html [end] -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ <h3 class="img-text-link__header">{data.header}</h3>
<p class="img-text-link__p">{data.bodytext}</p>
</f:if>
<f:if condition="{data.header_link}">
<f:link.typolink parameter="{data.header_link}" title="{data.subheader}" class="img-text-link__link">{data.subheader}</f:link.typolink>
<f:link.typolink parameter="{data.header_link}" title="{data.subheader}" class="img-text-link__link {f:if(condition: settings.linkAsBtn, then: 'btn btn-default', else: '')}">{data.subheader}</f:link.typolink>
</f:if>
</div>
<!-- theme_t3kit: Templates/ContentElements/ImageTextLink.html [end] -->
Expand Down

0 comments on commit ad149ce

Please sign in to comment.