Feature #76910
closedPageLayoutView - Allow to disable copy- / translate- buttons
100%
Description
Could there be an option to configure visibility of the "translate" and "copy" buttons (see Screenshot - I use TYPO3 7.6.9).
In \TYPO3\CMS\Backend\View\PageLayoutView following data-attributes were set to the button .t3js-localize in Line 1828 and 1829 :
' data-allow-copy="' . (int)$allowCopy . '"'
' data-allow-translate="' . (int)$allowTranslate . '"'
if you set $allowCopy or $allowTranslate manually to 0 the button for copying or translating your content will disappear, but you have no opportunity to do this by a configuration or by a hook.
Files
Updated by Peter Rauber over 8 years ago
Hi Philipp
I know a way how to hide this via css in the backend:
Here is my scss-file, that will complie into an css-file:
// hide copy in page-module localization wizard (only translation allowed) .t3-modal { &.localization-wizard { #localization-carousel { .item { .row { .t3js-helptext { display: none; } &:last-child { display: none; } &:first-child { display: block; } } .t3js-summary { .row { &:last-child { display: block; } } } } } } }
To load the css in the backend, put this in your ext_tables.php (of an extension):
// add own backend stylesheet if (TYPO3_MODE === 'BE') { // Register as a skin $GLOBALS['TBE_STYLES']['skins']['yourextensionname'] = array( 'name' => 'yourextensionname', 'stylesheetDirectories' => array( 'css' => 'EXT:yourextensionname/Resources/Public/Css/' ) ); }
Hope this helps.
Updated by Riccardo De Contardi over 8 years ago
- Category set to Backend User Interface
Updated by Sven Liebendahl over 7 years ago
Hi Phillip,
me and my colleagues stumbled across the same issue: We simply wanted to disable the strict translation-mode button in the localization wizard.
I asked for help in the slack channel #cig-localization and a suggested solution by Andreas Fernandez was to use XCLASSing – which worked for me. I know it is not the best way possible, but it is a working solution:
XCLASSing TYPO3\CMS\Backend\View\PageLayoutView
and overriding the method newLanguageButton
should be sufficient. Hint: either data-allow-copy
or data-allow-translate
must be 0
respectively false
then.
It would be handy if you could configure that with typoscript so that you easily can choose the available modes (buttons) of translation.
Updated by Gerrit Code Review over 7 years ago
- Status changed from New to Under Review
Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/52345
Updated by Andreas Fernandez over 7 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset 9e01773ce29f2372f91aa26e3044156337236abd.
Updated by André Buchmann almost 6 years ago
- Status changed from Closed to New
The PageTS Setting
mod.web_layout.localization.enableCopy = 0does not remove the copy button in the translation modal.
The other option
mod.web_layout.localization.enableTranslate = 0works as expected.
Tested with TYPO3 9.5.1 in custom installation and a installation with the introduction package.
Updated by André Buchmann almost 6 years ago
After a bit of debugging I found out that the setting is overwritten on line 2435 in typo3/sysext/backend/Classes/View/PageLayoutView.php
if there are no translations for the selected language.
If there is nothing on the translated page the variable $this->languageHasTranslationsCache[$lP]['hasTranslations']… will be @false
. The inverted value is then set for $allowCopy
. This behavior was implemented to fix an other Bug #62550
Updated by Gerrit Code Review almost 6 years ago
- Status changed from New to Under Review
Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/59016
Updated by Gerrit Code Review almost 6 years ago
Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/59016
Updated by Gerrit Code Review almost 6 years ago
Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/59016
Updated by Gerrit Code Review almost 6 years ago
Patch set 4 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/59016
Updated by Gerrit Code Review almost 6 years ago
Patch set 5 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/59016
Updated by Gerrit Code Review almost 6 years ago
Patch set 6 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/59016
Updated by Anonymous almost 6 years ago
- Status changed from Under Review to Resolved
Applied in changeset 2c6539228043af6c7eb1c4305eb37796e4327e44.
Updated by Jasmina Ließmann almost 6 years ago
Is there any chance to get a backport of this fix for TYPO3 CMS 8.7?
The setting 'mod.web_layout.localization.enableCopy = 0' does not work for me with TYPO3 CMS 8.7.24.
Updated by André Buchmann almost 6 years ago
Hello Jasmina,
there won't be a backport for 8.7 as the feature was introduced in 9.5 first. This ticket is related to a bug in this feature only.
Updated by Christoph Lehmann about 4 years ago
- Related to Bug #92564: Mixed content problem through translation button in list view added