0
votes

I installed the page route module and it works great, but the only problem is that the submit/next/back buttons are always displayed on top.

I have this custom module installed, which I thought would ensure that the profile node form (content profile node) and the CCK group field specified (group_personal) would move up based on their weight, but it does not seem to work.

Can anyone help ? Am I using the right code to specify a group field ? Or is there a way I can specify the entire form ?

<?php
function pageroute_buttons(&$form, $form_state, $form_id) {
    switch ($form_id) {
        case 'profile_node_form':
            if(arg(0) == 'registration'){
                $form['group_personal']['#weight'] = -10;
            }
      }
}
?>
1

1 Answers

0
votes

You should make sure that your module is running AFTER the form has been built up. In the system table locate the row for your custom module and set it's weight column to something higher than the page route module. I'd also recommend installing the Dev module and doing a dpm() printout to check your module is being called and see exactly the form composition at that stage and adjust the weights properly (when using CCK drag and drop ordering, you may need -100 instead of -10 to ensure it's always on top.).