(function() { _.extend(scrivito, { path_for_id: function(id) { return '/__scrivito/' + id; }, id_from_path: function(url) { // -- PATCH BEGINS HERE -- var match = /__scrivito\/([a-z0-9]{4,})/.exec(url); // -- PATHC ENDS HERE -- if (match) { return match[1]; } } }); })();