Add Page programatically
Permalink
Hi All,
In desparate need of help here.
I am trying to create a page at root level after submitting a form.
I am doing the following (of which I have tried multiple ways)
however on execution I am getting this error
mysql error: [1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'LIMIT 1' at line 1] in EXECUTE("select max(cDisplayOrder) from Pages where cParentID = LIMIT 1")
HELP!
In desparate need of help here.
I am trying to create a page at root level after submitting a form.
I am doing the following (of which I have tried multiple ways)
//$arrPage is set above with name hande and date public $parentPage = Page::getByPath("/index"); $pt = CollectionType::getByHandle('pagetype'); $newPage = $parentPage->add($pt,$arrPage);
however on execution I am getting this error
mysql error: [1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'LIMIT 1' at line 1] in EXECUTE("select max(cDisplayOrder) from Pages where cParentID = LIMIT 1")
HELP!
If this is supposed to be the home page, then that page doesn't have a path. You'd be better off using:
This works for me as a tools url: