Changing page and component types after merchants create pages
Key Takeaway
After merchants create pages, don't make incompatible changes to a type. To change the type value of an existing component attribute, create a new component type and deprecate the old one.
In Page Designer, developers build page types and component types. Merchants use them to create real pages in Business Manager. The pages that merchants create are stored data that depend on the type definitions. So if you change a type later, the stored data can fall out of step with its definition. The safe approach is to avoid incompatible edits and to create a new type when a change would be incompatible.
How saved pages depend on types
A developer defines each page type and component type with two files in a custom cartridge: a JSON meta definition file and a script file. Merchants then reuse those same types to build many pages in the Page Designer visual editor, without going back to the developer.
Pages and components are stored in the database as content assets. Each one records the type it was built from in its type attribute. The format is page.{page_type_id} for a page and component.{component_type_id} for a component. A component also stores the merchant's attribute values as JSON in its data attribute.
A type's ID comes from its subdirectory path and file name, joined with periods.
pages/storefront/campaigns/homepage.json
=> storefront.campaigns.homepageA page built from this page type stores page.storefront.campaigns.homepage in its type attribute. So moving or renaming the files gives the type a different ID from the one that existing pages and components store in their type attribute.