-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[BUGFIX] page module shows exception if a FCE has no mapping
There might be the case a tt_content FCE has no mapping, e.g. if an existing tt_content is switched to type FCE, not setting a mapping and saving. This patch changes the output template to show a warning message for that element to catch that exception.
- Loading branch information
1 parent
6a3e0c4
commit c169b31
Showing
2 changed files
with
30 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 27 additions & 18 deletions
45
Resources/Private/Partials/Backend/Preview/Templavoilaplus_pi1.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,36 @@ | ||
{namespace tvp=Tvp\TemplaVoilaPlus\ViewHelpers} | ||
|
||
<f:variable name="labelFromItemlist" value="{tvp:backend.labelFromItemlist(table:'tt_content', fieldName:'CType', key:'{node.raw.entity.CType}')}" /> | ||
<f:variable name="nameMappingConfiguration" value="{tvp:backend.labelFromMappingConfiguration(identifier:'{node.raw.entity.tx_templavoilaplus_map}')}" /> | ||
<f:if condition="{labelFromItemlist} || {nameMappingConfiguration}"> | ||
<strong> | ||
<f:if condition="{node.raw.entity.tx_templavoilaplus_map}"> | ||
<f:then> | ||
<f:variable name="labelFromItemlist" value="{tvp:backend.labelFromItemlist(table:'tt_content', fieldName:'CType', key:'{node.raw.entity.CType}')}"/> | ||
<f:variable name="nameMappingConfiguration" value="{tvp:backend.labelFromMappingConfiguration(identifier:'{node.raw.entity.tx_templavoilaplus_map}')}"/> | ||
<f:if condition="{labelFromItemlist} || {nameMappingConfiguration}"> | ||
<strong> | ||
<f:if condition="{labelFromItemlist}"> | ||
<f:translate key="{labelFromItemlist}" default="{labelFromItemlist}" /> | ||
<f:translate key="{labelFromItemlist}" default="{labelFromItemlist}"/> | ||
</f:if> | ||
<f:if condition="{nameMappingConfiguration}"> | ||
<f:translate key="{nameMappingConfiguration}" default="{nameMappingConfiguration}" /> | ||
<f:translate key="{nameMappingConfiguration}" default="{nameMappingConfiguration}"/> | ||
</f:if> | ||
</strong> | ||
<br /> | ||
</f:if> | ||
|
||
<f:for each="{node.datastructure.sheets.sDEF.ROOT.el}" key="fieldName" as="fieldConfig"> | ||
<f:if condition="{fieldConfig.TCEforms.label}"> | ||
<strong><f:translate key="{fieldConfig.TCEforms.label}" default="{fieldConfig.TCEforms.label}" /></strong> | ||
</strong> | ||
<br/> | ||
</f:if> | ||
<f:format.crop maxCharacters="2000"> | ||
|
||
<f:for each="{node.datastructure.sheets.sDEF.ROOT.el}" key="fieldName" as="fieldConfig"> | ||
<f:if condition="{fieldConfig.TCEforms.label}"> | ||
<strong> | ||
<f:translate key="{fieldConfig.TCEforms.label}" default="{fieldConfig.TCEforms.label}"/> | ||
</strong> | ||
</f:if> | ||
<f:format.crop maxCharacters="2000"> | ||
<tvp:format.wordLength maxCharacters="75"> | ||
<tvp:format.stripTags whitespace="true">{node.flexform.data.sDEF.lDEF.{fieldName}.vDEF}</tvp:format.stripTags> | ||
<tvp:format.stripTags whitespace="true">{node.flexform.data.sDEF.lDEF.{fieldName}.vDEF}</tvp:format.stripTags> | ||
</tvp:format.wordLength> | ||
</f:format.crop> | ||
<br> | ||
</f:for> | ||
</f:format.crop> | ||
<br> | ||
</f:for> | ||
</f:then> | ||
<f:else> | ||
<f:translate key="LLL:EXT:templavoilaplus/Resources/Private/Language/Backend/PageLayout.xlf:error.fce.noMapping"/> | ||
</f:else> | ||
</f:if> |