Imagine you have the 4 crop variants "Desktop", "Landscape", "Tablet"
and "Mobile" at your disposal, then it may happen that you have to copy the
crop area of "Desktop" to all other crop variants. Slight shifts of the image
crop between the crop variants are almost inevitable. sync_crop_areas
provides a remedy here and offers you to transfer the image crop of the
first crop variant (here: "Desktop") to all other crop variants with the
same image ratio.
Imagine you have the 4 crop variants "Desktop", "Landscape", "Tablet"
and "Mobile" at your disposal, then it may happen that you have to copy the
crop area of "Desktop" to all other crop variants. Slight shifts of the image
crop between the crop variants are almost inevitable. sync_crop_areas
provides a remedy here and offers you to transfer the image crop of the
first crop variant (here: "Desktop") to all other crop variants with the
same image ratio.
Installation
Composer
If your TYPO3 installation works in composer mode, please execute
following command:
On non composer based TYPO3 installations you can install sync_crop_areas
still over the ExtensionManager:
Login
Login to backend of your TYPO3 installation as an administrator
or system maintainer.
Open ExtensionManager
Click on Extensions from the left menu to open the ExtensionManager.
Update Extensions
Choose Get Extensions from the upper selectbox and click on
the Update now button at the upper right.
Install sync_crop_areas
Use the search field to find sync_crop_areas. Choose
the sync_crop_areas line from the search result and click on the cloud
icon to install sync_crop_areas.
EXT:sync_crop_areas itself does not need any configuration, but it needs a
configured crop column in TCA of table sys_file_reference. Usually you
should have a file Configuration/TCA/Overrides/sys_file_reference.php
in your SitePackage where CropVariants are defined. Of cource you also can
build up the CropVariants with PageTSConfig.
EXT:sync_crop_areas will only sync values of CropVariants with same ratio.
In example above 4:3 exists in both CropVariants so syncing these
CropVariants will not be a problem.
Usually a TCA reference to sys_file_reference in your extension should
look like:
I can't copy 2nd or 3rd cropVariant to all other cropVariants
Currently we only support copying the cropArea of the first cropVariant. So, you can't decide to copy
the cropArea of the second or fourth cropVariant back to all other cropVariants
In our DataHandler Hook we check, if first cropArea with its ratio is allowed for all other cropVariants. If a
CropVariant does not have the ratio of the first CropVariant sync_crop_areas keeps this CropVariant untouched.
Please check, if your editors have access rights to column sys_file_reference:sync_crop_area. This column is deactivated
by default, so, if an editor has no rights for this column, the CropVariants can't be synchronized.
Is there an automatism to upgrade all sys_file_reference records?
If you add sync_crop_areas the first time to a project or you have added further CropVariants, you may have the problem
that you have 1000s of sys_file_reference records which have CropVariants out-of-sync. Instead of opening each
record and save it, you can use a CLI command or scheduler task.
sync_crop_areas does not work for column of extension XY
First of all it's not the TYPO3 core itself which adds cropping feature to sys_file_reference, it's TYPO3 sysext
frontend. The core initializes sys_file_reference with just title and description for all kind of files in
TCA palette basicoverlayPalette. For each table in TYPO3 universe which contains a relation to sys_file_reference
it is possible to overwrite the displayed columns or palettes. Sysext frontend contains the TCA for
table tt_content which of cause has a relation to sys_file_reference. In its TCA it overwrite palette
basicoverlayPalette to imageoverlayPalette which also contains the column crop for all image filetypes.
EXT:sync_crop_areas simply searches for crop in palette imageoverlayPalette and adds our own column
sync_crop_area before crop.
Some extension authors like bootstrap_package do not make use of TYPO3 palette imageoverlayPalette. That's why
column sync_crop_area is not visible. So it's up to you to add this missing column to such extensions.
You need the table name of the foreign extension and the column name where the sync_crop_areas feature is missing.
As we want to modify the TCA of one or more foreign extensions we should be sure to load the foreign
extensions BEFORE your site_package. Go into
typo3conf/ext/[my_site_package]/ext_emconf.php
and check, if all extensions with missing sync_crop_area column is listed
in section depends. Here an example for bootstrap_package: