hi
how to i can create new page type with custom field by kentico api in my webpart?
Its a pretty involved task you're looking to do. I'd suggest start by looking at the code that's already there to do this task in this folder: \CMSModules\DocumentTypes\Pages\Development\
There is a DocumentType_New.aspx file that references a user control located in this folder: \CMSModules\AdminControls\Controls\Class\NewClassWizard.ascx. This control should have what you're looking for. If you're looking to customize it, I'd suggest creating a clone of it before modifying the base control.
Hello,
I have some question about to create and delete page types. I tried this scenario:
1.) I created a new page type (with name tmp) with "Allowed parent page types" as "Root (CMS.Root)"
2.) Then I created page in me site inherited from tmp type in root of me site
3.) Then I changed inheritance type for page tmp to none
I looked back to me web and there are no changes or mark, that this page is no more allowed to inherit from root. There are also no message (when I deleted page type) about pages which is currently inherited from. Is it possible to add some extra message (when page type parents is changed or delete) or mark to tree about this ?
Thank you.
The answer posted by Brenden Kehren answered on February 18, 2015 20:23 on this same thread works - the Kentico UI Wizard component basically uses various Kentico APIs (Table Manager, Document Class Info, FormInfo, FormFieldInfo, etc) to assemble a page type or a custom table definition correctly.
That Wizard's code can be traced through and copied & pasted to construct your Kentico object definition of choice.
I have been able to create a unit test based on the Wizard's code in which I new up Page Types (formerly Doc Types) on-the-fly by calling a method with a new namespace and codename, for headless testing purposes.
Please, sign in to be able to submit a new answer.