Creating a page type with custom attributes in page composer layout set in package controller.php
Permalink 1 user found helpfulI want to create a package that on install adds three custom attributes, one page type and adds a composer layout set for the page type with the three custom attributes. I've managed to create the page type and the attributes, but I can't figure out how to create the composer layout form.
Does anyone have an idea?
I've seen and taken a lot of help fromhttps://www.concrete5.org/community/forums/5-7-discussion/installing...
and
https://github.com/core77/foundation_sites/blob/master/controller.ph...
Cheers

That class handles adding the new PageType, and by setting the optional flag 'ptLaunchInComposer' the new PageType will open in composer. I'm going to search through the rest of the page type class to see if has functions for attaching attributes or composer settings.
// $pt = PageTypeType::add(... $set = $pt->addPageTypeComposerFormLayoutSet("Basics", ""); $added = (new NameCorePageProperty())->addToPageTypeComposerFormLayoutSet($set); $added->updateFormLayoutSetControlRequired(true); $added->updateFormLayoutSetControlCustomLabel("Page Name"); $added = (new DescriptionCorePageProperty())->addToPageTypeComposerFormLayoutSet($set); $added = (new UrlSlugCorePageProperty())->addToPageTypeComposerFormLayoutSet($set); $added = (new PublishTargetCorePageProperty())->addToPageTypeComposerFormLayoutSet($set); $added = (new PageTemplateCorePageProperty())->addToPageTypeComposerFormLayoutSet($set);