How to programmatically create a Page Node??

HeadHodge

Active member
My add-on requires a Page node to function properly.

How can I add the required Page from my install program?
 
It's definitely not the best option and not recommended. But you'll need to use the page DataWriter. Take a look at actionSave in the admin controller for pages
 
Why does it require a page node? Any reason against just creating a controller and route?
Sorry... I didn't give you a very good answer earlier.

We use the node tree as basically our main menu and it's easy to (manually) insert Page nodes into the node tree. Not sure how I would do that with the controller/route method. It's seems (to me) there is no easy way to programmatically add a node (no matter which type of node it is).

It's easy to add a new record to the Page table, but not so easy to the Node table because it's doing some B-tree pointer type stuff that doesn't seem easy to calculate. :(

So calling their data-writer is probably going to be the easiest way.
 
Back
Top Bottom