fix: article detail — photos on top, no ID, eBay description without scrollbar

Photos field moved to first position. ID field removed entirely. eBay
description on detail uses a custom template that renders raw HTML in a
plain div (no span/title wrapper, no overflow constraints). Form view
keeps the textarea editor.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Simon Kuehn 2026-05-18 11:19:42 +00:00
parent a381ee6531
commit ad9cb279c9
2 changed files with 16 additions and 5 deletions

View file

@ -97,7 +97,11 @@ final class ArticleCrudController extends AbstractCrudController
public function configureFields(string $pageName): iterable public function configureFields(string $pageName): iterable
{ {
yield IdField::new('id')->hideOnForm()->hideOnIndex(); // Detail-only: photos first
yield Field::new('photos', new TranslatableMessage('field.photos', [], 'admin'))
->setTemplatePath('admin/field/photos.html.twig')
->onlyOnDetail();
yield TextField::new('inventoryNumber', new TranslatableMessage('field.inventory_number', [], 'admin'))->hideOnForm(); yield TextField::new('inventoryNumber', new TranslatableMessage('field.inventory_number', [], 'admin'))->hideOnForm();
yield AssociationField::new('articleType')->hideOnForm(); yield AssociationField::new('articleType')->hideOnForm();
yield TextField::new('ebayTitle', new TranslatableMessage('field.description', [], 'admin'))->setRequired(false); yield TextField::new('ebayTitle', new TranslatableMessage('field.description', [], 'admin'))->setRequired(false);
@ -120,7 +124,6 @@ final class ArticleCrudController extends AbstractCrudController
yield TextField::new('sku')->hideOnForm()->hideOnIndex(); yield TextField::new('sku')->hideOnForm()->hideOnIndex();
yield TextField::new('serialNumber', new TranslatableMessage('field.serial_number', [], 'admin'))->setRequired(false)->hideOnIndex(); yield TextField::new('serialNumber', new TranslatableMessage('field.serial_number', [], 'admin'))->setRequired(false)->hideOnIndex();
yield TextField::new('conditionNotes', new TranslatableMessage('field.condition_notes', [], 'admin'))->setRequired(false)->hideOnIndex(); yield TextField::new('conditionNotes', new TranslatableMessage('field.condition_notes', [], 'admin'))->setRequired(false)->hideOnIndex();
yield TextareaField::new('ebayDescription', new TranslatableMessage('field.ebay_description', [], 'admin'))->setRequired(false)->hideOnIndex()->renderAsHtml();
yield Field::new('attributeValues', new TranslatableMessage('field.attributes', [], 'admin')) yield Field::new('attributeValues', new TranslatableMessage('field.attributes', [], 'admin'))
->onlyOnDetail() ->onlyOnDetail()
@ -143,9 +146,16 @@ final class ArticleCrudController extends AbstractCrudController
->allowAdd(false) ->allowAdd(false)
->allowDelete(false); ->allowDelete(false);
yield Field::new('photos', new TranslatableMessage('field.photos', [], 'admin')) if (Crud::PAGE_DETAIL === $pageName) {
->setTemplatePath('admin/field/photos.html.twig') yield Field::new('ebayDescription', new TranslatableMessage('field.ebay_description', [], 'admin'))
->onlyOnDetail(); ->setTemplatePath('admin/field/ebay_description.html.twig')
->onlyOnDetail();
} else {
yield TextareaField::new('ebayDescription', new TranslatableMessage('field.ebay_description', [], 'admin'))
->setRequired(false)
->hideOnIndex()
->setNumOfRows(20);
}
} }
#[AdminRoute('/rerun-ai', name: 'rerunAi')] #[AdminRoute('/rerun-ai', name: 'rerunAi')]

View file

@ -0,0 +1 @@
<div class="ebay-description-preview">{{ field.formattedValue|raw }}</div>