Feature #59833
closedlevelmedia translation fallback
0%
Description
Hello there,
I recently run into a use case that was not covered by the standard TYPO3 features: translation fallback for levelmedia.
Explanation: we set up a new field for pages that is used to set a banner on the page. This banner may change according to the current page language (since banner may contain text in different languages). Now the customer didn't have the time to replace all the banners on time, so we needed a fallback to the standard translation.
Sadly, this wasn't covered by levelmedia yet, also the l10n_mode
'mergeIfNotBlank'
didn't do the trick, so I developed the following patch:
in TYPO3 4.5.x: typo3/sysext/cms/tslib/class.tslib_content.php:5261
in TYPO3 6.2.x: typo3/sysext/frontend/Classes/ContentObject/ContentObjectRenderer.php:5426
case 'levelfield': $keyP = t3lib_div::trimExplode(',', $key); $nkey = $this->getKey($keyP[0], $GLOBALS['TSFE']->tmpl->rootLine); $rootLine = $GLOBALS['TSFE']->tmpl->rootLine; /** cab st: 2014-06-23: add an additional parameter for levelfield so you can take the value from the * original page data. If there wasn't any, check the other levels for values. As soon as a value is found, we * break the loop. */ if($keyP[3] == 'from_original') { for($i = $nkey; $i >= 0; $i--) { if(empty($rootLine[$i][$keyP[1]])) { // try to get the original $newRow = $GLOBALS['TYPO3_DB']->exec_SELECTgetSingleRow( '*', 'pages', 'uid = ' . $rootLine[$i]['uid'] ); if(!empty($newRow[$keyP[1]])) { $rootLine[$i][$keyP[1]] = $newRow[$keyP[1]]; break; } } else { // we already are on a superior level that has content, so no untranslation needed break; } } } $retVal = $this->rootLineValue($nkey, $keyP[1], strtolower($keyP[2]) == 'slide', $rootLine); /** cab st end */ break;
This patch is completely backwards compatible since you have to add a parameter to the levelfield after slide.
Best Regards
Tizian
Updated by Markus Klein over 10 years ago
- Category set to Content Rendering
- Target version changed from next-patchlevel to 7.0
Hi Tizian,
can you please push that patch to our review system?
http://wiki.typo3.org/CWT holds information on how to do that.
Thanks
Updated by Frans Saris over 10 years ago
Can't we use any existing param for this? I see this more like a bug then a feature
Updated by Mathias Schreiber almost 10 years ago
- Target version changed from 7.0 to 7.1 (Cleanup)
Updated by Mathias Schreiber almost 10 years ago
- Target version changed from 7.1 (Cleanup) to 7.2 (Frontend)
Updated by Benni Mack over 9 years ago
- Target version changed from 7.2 (Frontend) to 7.4 (Backend)
Updated by Susanne Moog over 9 years ago
- Target version changed from 7.4 (Backend) to 7.5
Updated by Benni Mack about 9 years ago
- Target version changed from 7.5 to 7 LTS
Updated by Oliver Hader almost 9 years ago
- Status changed from New to Needs Feedback
If #65863 would be solved to support mergeIfNotBlank on these rootline fields, then this very feature would be obsolete, right?
Updated by Alexander Opitz over 8 years ago
- Status changed from Needs Feedback to Closed
No feedback within the last 90 days => closing this issue.
If you think that this is the wrong decision or experience this issue again, then please write to the mailing list typo3.teams.bugs with issue number and an explanation or open a new ticket and add a relation to this ticket number.