Create Form Tab Layout
Developmentcreate-form-tab-layoutCreate Form Tab Layout is an Agent Skill for development published in the PrestaShop/PrestaShop repository on GitHub: a SKILL.md instruction file an AI agent can load to do this task.
Create a multi-tab form layout using PrestaShop's NavigationTabType. This is a specific pattern for complex forms with many fields organized by tabs — NOT the default form layout. Most forms do not need tabs. Trigger: "create tab layout for {Domain} form", "add tabs to {Domain} form".
How to use this skill
Bring this guide into your coding agent with a prompt tailored to the tool you use.
- Open your project in Codex.
- Copy and paste the prompt below.
- Review files and risks before approving any action.
Inspect the Agent Skill at https://github.com/PrestaShop/PrestaShop/blob/HEAD/.ai/Component/Forms/skills/create-form-tab-layout/SKILL.md and all supporting files. Report provenance, permissions, scripts, dependencies, and security risks. Propose an exact installation into .agents/skills/create-form-tab-layout, but wait for my approval before writing files or running scripts.
Copying this prompt does not install or run the skill. Review third-party files before use.
create-form-tab-layout
This is NOT the default form pattern. Most entity forms are simple single-page forms using
TranslatorAwareTypeorAbstractType. Only useNavigationTabTypewhen the entity has many fields that benefit from tab organization (e.g. Carrier with general, shipping, size/weight tabs).
Instructions
- In root
{Domain}Type, declareNavigationTabTypeas the parent type viagetParent():
Then inpublic function getParent(): string { return NavigationTabType::class; }buildForm(), add each tab as a sub-form — each child is rendered as a tab. - Create one form type per tab:
{Domain}GeneralTabType.php,{Domain}ShippingTabType.php, etc. - Each tab type extends
TranslatorAwareTypewith its ownbuildForm()containing only that tab's fields. - Tab anchor IDs (used for JS error scrolling) are derived from the tab names.
Reference: src/PrestaShopBundle/Form/Admin/Shipping/Carrier/CarrierType.php, src/PrestaShopBundle/Form/Admin/Sell/Product/EditProductFormType.php
Rules
Conventions (NavigationTabType is PS-specific, tab anchor IDs for JS error nav) are in Forms/CONTEXT.md. Skill-specific reminders:
- Each tab gets its own form type class for maintainability
- Tab titles must use
$this->trans()for translation