• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

How to programmatically create a Page Node??

Jake B.

Well-known member
#4
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
 

HeadHodge

Active member
#6
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.