Is there a way to use auto increment for the menu-index ? I’ve been trying some things in fdm.class.inc.php (for example: $fields[’menu_index’]=$modx->db->getInsertId(); ), but to no avail...
In the preferences the auto increment is enabled and when I add a new page to the container where the doc has to go to the menu-index gets incremented correctly..
Any ideas?
EDIT: got a fix for it, see code
//menu-index autoincrement
$fdmpid = intval($_SESSION['fdm']['parent']);
$tbl = $modx->getFullTableName("site_content");
$sql = "SELECT count(*) as 'cnt' FROM $tbl WHERE parent='$fdmpid'";
$fields["menuindex"] = $modx->db->getValue($sql);
Put this in fdm.class.inc.php, somewhere in
function fillDoc(&$fields) and you’ll have the menu-index autoincremented