' . "\n"; if ($editable) { // Use split-format so the image and its alt text live at two sibling keys // (sections.N.image, sections.N.alt) — preserves title/content in the same // section object. Defaults alt to the title when empty. $defaultAlt = $section['alt'] ?? ($title !== '' ? $title : 'Image'); $html .= ' ' . raijuAiLabelFrame(editableImageSplit($page, "sections.$index.image", "sections.$index.alt", $image, $defaultAlt)) . "\n"; $html .= '

' . editableText($page, "sections.$index.title", $title) . '

' . "\n"; $html .= '

' . editableText($page, "sections.$index.content", $content) . '

' . "\n"; } else { if (!empty($image)) { $alt = !empty($section['alt']) ? $section['alt'] : ($title !== '' ? $title : 'Image'); $html .= ' ' . raijuAiLabelAttach('' . htmlspecialchars($alt) . '', (string)$image, true) . "\n"; } if ($title !== '') { $html .= '

' . htmlspecialchars($title) . '

' . "\n"; } if ($content !== '') { $html .= '

' . htmlspecialchars($content) . '

' . "\n"; } } $html .= '' . "\n"; return $html;