Quote from: Dimmy at Apr 13, 2007, 08:38 AM
you could look at the doc id’s and get the latest one and add 1 to it.
Not good if you create a document, delete it (and remove from the db table) and then create a new one.
The first ID is "used", since the auto increment index in the table is increased.
The "+1" method would fail.
First, create a new document, set it "not visible in menu", set it "unpublished", and insert it into the database.
Second, get ID of last created document (function $MODx->db->getInsertId or the result of function $MODx->db->insert) and edit the content, then save it and publish it.
Just like Susan said.
Basically, you create a new document in two steps, but the user knows and cares nothing about this.