Moving OpenAtrium Node Form Elements to the Right Column
grayside — Sat, 03/06/2010 - 12:01
Previously, I discussed how you could move CCK fields into the node form sidebar by careful fieldgroup naming.
If you are of a programmer’s bent, you might instead try the more flexible programmer’s solution—preprocessor function. I dug this out of the atrium_blog feature.
This code snippet isolates a nodereference field attached to blog content and pushes it into the sidebar. This should work to move entire fieldgroups of form elements too.
/**
* Preprocessor for theme('node_form').
*/
function atrium_blog_preprocess_node_form(&$vars) {
if (!empty($vars['form']['field_referenced_book_page'])) {
$vars['sidebar']['field_referenced_book_page'] = $vars['form']['field_referenced_book_page'];
unset($vars['form']['field_referenced_book_page']);
}
}