Currently it is difficult to hook into the subsite creation / editing / deletion process. In my particular case I want to add an extra textfield to the subsite edit form, of which I store the value afterward in a subsite-specific site variable (with variable_set()).

Adding the text field is easy, by implementing hook_form_FORM_ID_alter(). In an additional #submit callback I can theoretically use db_last_insert_id('subsites', 'sid') to get the sid of newly created subsites, but this looks a bit cumbersome and error-prone to me.

Ideally, a hook similar to hook_user() and hook_nodeapi() should be available where you can hook into the creation / editing and deletion process of subsites and have access to all necessary data.

Comments

davyvdb’s picture

I'm open for this but I lack the time to implement this soon. If you write a patch, I'll commit it.