BG fixes for COntainer

This commit is contained in:
2026-08-14 11:07:55 +02:00
parent 58990ebe8d
commit b08ea7a55f
3 changed files with 15 additions and 5 deletions

View File

@@ -50,7 +50,13 @@ if ($cols === []) {
} }
echo "\n=== 2) The record itself (uid $uid) ===\n"; echo "\n=== 2) The record itself (uid $uid) ===\n";
$row = $pdo->query("SELECT uid, pid, CType, deleted, hidden, sys_language_uid, l18n_parent, tx_vitec_bg_variant, tx_vitec_bg_image, tx_vitec_bg_size, tx_vitec_bg_position FROM tt_content WHERE uid = $uid")->fetch(); // Column list built from section 1 rather than hard-coded, so every tx_vitec_bg_*
// field added later shows up here without the script needing an edit.
$select = array_merge(
['uid', 'pid', 'CType', 'deleted', 'hidden', 'sys_language_uid', 'l18n_parent'],
array_column($cols, 'Field')
);
$row = $pdo->query('SELECT ' . implode(', ', $select) . " FROM tt_content WHERE uid = $uid")->fetch();
if (!$row) { if (!$row) {
echo " no tt_content row with uid $uid\n"; echo " no tt_content row with uid $uid\n";
} else { } else {

View File

@@ -125,15 +125,16 @@ use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
foreach (['top', 'bottom', 'left', 'right'] as $edge) { foreach (['top', 'bottom', 'left', 'right'] as $edge) {
$positionOffsets['tx_vitec_bg_pos_' . $edge] = [ $positionOffsets['tx_vitec_bg_pos_' . $edge] = [
'label' => $l . 'bg_pos.' . $edge, 'label' => $l . 'bg_pos.' . $edge,
'description' => $l . 'bg_pos.description',
'displayCond' => 'FIELD:tx_vitec_bg_position:=:custom', 'displayCond' => 'FIELD:tx_vitec_bg_position:=:custom',
'config' => [ 'config' => [
'type' => 'number', 'type' => 'number',
'size' => 5, 'size' => 5,
'nullable' => true, 'nullable' => true,
'range' => [ // No range on purpose: background-position accepts values below
'lower' => 0, // 0 and above 100, which is how you push an image partly out of
'upper' => 100, // its container. Capping at 0..100 would forbid exactly the
], // layouts these free offsets exist for.
], ],
]; ];
} }

View File

@@ -258,6 +258,9 @@
<trans-unit id="bg_pos.right" resname="bg_pos.right"> <trans-unit id="bg_pos.right" resname="bg_pos.right">
<source>Right %</source> <source>Right %</source>
</trans-unit> </trans-unit>
<trans-unit id="bg_pos.description" resname="bg_pos.description">
<source>Distance from that edge, in percent. Leave empty to centre on this axis. Values below 0 and above 100 are allowed and push the image beyond the edge. Filling both ends of an axis is contradictory - the near edge wins (left over right, top over bottom).</source>
</trans-unit>
</body> </body>
</file> </file>