Cards visible in the FE; /products cards wrapped into 33/33/33 grids
- the freshly attached card images did not show: text_only is the explicit no-image variant, so vitec:attach-card-images now flips a card to "vertical" whenever it carries (or receives) an image; and the new placeholder PNGs sat in the sshfs 770 trap - fix-asset-perms covers them, with public/product-audit added to its targets - new generic vitec:wrap-cards-grid --page=<slug>: wraps a page's cards into vitec_cols_33_33_33 containers (b13 columns 221/222/223), three per container, section-aware - every top-level intro paragraph starts a section, other element types close it, so the category headings on /products keep their grids beneath them. Existing grid containers are pooled and reused, surplus ones hidden - the first apply aborted mid-move and left a half state (15 empty shells, three cards moved; diagnosis migrations/check_grid_447.php, kept) - v2 repairs such states by design: global container pool, hard asserts after the create pass, try/catch around the move pass, and a final "no card left top-level" verification - applied on /products and verified live: 38 cards in 15 grids (sections 5/7/3/6/2/4/2/6/3 -> 2/3/1/2/1/2/1/2/1 containers), order intro -> grids -> banner -> faq intact, children delivered in the known items/contentElements shape Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
c8d653b39b
commit
b0690c4cdc
4 files changed
+301
-5
No files matched your search
@@ -77,10 +77,10 @@ final class AttachCardImagesCommand extends Command
|
||||
|
||||
$datamap = [];
|
||||
$newIndex = 0;
|
||||
$stats = ['photo' => 0, 'placeholder' => 0, 'grey' => 0, 'kept' => 0, 'missing' => []];
|
||||
$stats = ['photo' => 0, 'placeholder' => 0, 'grey' => 0, 'kept' => 0, 'variant' => 0, 'missing' => []];
|
||||
foreach ($pageUids as $pageUid => $slug) {
|
||||
$cards = $content->fetchAllAssociative(
|
||||
"SELECT uid, header, vitec_primary_cta FROM tt_content
|
||||
"SELECT uid, header, vitec_primary_cta, vitec_layout_variant FROM tt_content
|
||||
WHERE deleted = 0 AND hidden = 0 AND pid = ? AND CType = 'vitec_card'
|
||||
ORDER BY colPos, sorting",
|
||||
[$pageUid]
|
||||
@@ -104,6 +104,13 @@ final class AttachCardImagesCommand extends Command
|
||||
);
|
||||
if ($existing > 0) {
|
||||
$stats['kept']++;
|
||||
// a card that carries an image must not stay on the
|
||||
// explicit no-image variant (found 2026-10-27: the FE
|
||||
// correctly hides images on text_only)
|
||||
if ((string)$card['vitec_layout_variant'] === 'text_only') {
|
||||
$datamap['tt_content'][(string)$cardUid]['vitec_layout_variant'] = 'vertical';
|
||||
$stats['variant']++;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
$identifier = null;
|
||||
@@ -138,6 +145,10 @@ final class AttachCardImagesCommand extends Command
|
||||
if (!$apply) {
|
||||
continue;
|
||||
}
|
||||
if ((string)$card['vitec_layout_variant'] === 'text_only') {
|
||||
$datamap['tt_content'][(string)$cardUid]['vitec_layout_variant'] = 'vertical';
|
||||
$stats['variant']++;
|
||||
}
|
||||
$file = $storage->getFile($identifier);
|
||||
$datamap['sys_file_reference']['NEWCI' . (++$newIndex)] = [
|
||||
'pid' => $pageUid,
|
||||
@@ -150,8 +161,8 @@ final class AttachCardImagesCommand extends Command
|
||||
}
|
||||
}
|
||||
|
||||
$output->writeln(sprintf("\n%d product photo(s), %d numbered placeholder(s), %d generic grey, %d card(s) already had an image%s",
|
||||
$stats['photo'], $stats['placeholder'], $stats['grey'], $stats['kept'],
|
||||
$output->writeln(sprintf("\n%d product photo(s), %d numbered placeholder(s), %d generic grey, %d card(s) already had an image, %d variant flip(s) text_only->vertical%s",
|
||||
$stats['photo'], $stats['placeholder'], $stats['grey'], $stats['kept'], $stats['variant'],
|
||||
$stats['missing'] === [] ? '' : ' · MISSING numbered files: ' . implode(', ', $stats['missing'])));
|
||||
|
||||
if (!$apply) {
|
||||
|
||||
Reference in new issue
Block a user