In my pageroute the buttons appear above the content, but I want them at the bottom.

Is this possible?

Cheers

Ben

(if the submit buttons should be appearing at the bottom, let me know and I can try and provide more info)

CommentFileSizeAuthor
#3 pageroute.png12.42 KBnamtih58
#1 pageroute.jpg27.63 KBbkno

Comments

bkno’s picture

StatusFileSize
new27.63 KB
brei9000’s picture

I was just wondering the same thing! It would be nice.

namtih58’s picture

StatusFileSize
new12.42 KB

Having the same issue but with the buttons in the middle.

namtih58’s picture

The issue for the buttons appearing in the middle, is actually related to the #weight attribute. It appears that the buttons are inserted immediately after the Item with a weight of 0. The workaround is to go to the DB and change all the weight attributes of your content type fields to negative numbers with the last item before where you want the buttons to appear having a weight of 0.

brei9000’s picture

I'm having the same issue. I've added pageroute to my profile pages.

The HTML looks like this:

<span class="pageroute_buttons">
<input type="submit" name="page_op" id="edit-forward" value="Continue to Step 2"  class="form-submit pageroute-forward" />
</span>
<input type="hidden" name="form_build_id" id="form-123" value="form-123"  />
<fieldset>
.. more code
</fieldset>

But I'd like the button to come after the fieldset.

Ideas anyone?

white_pawn’s picture

It's absolutely counter-intuitive, and kind of hard to believe the developer(s) really wanted to have it at the top. I'm also hoping someone will come up with a solution.

bentekwork’s picture

#4 gave the correct solution to this. Simply login to phpMyAdmin (if using mysql) navigate to the table named `content_group` and click the pencil to edit the row with the content type you are looking to move the buttons for. Change the weight field to -10 and then click save. Repeat for any other groups for the same content type. When complete login to your drupal installation and flush caches.

white_pawn’s picture

Didn't work. I'm using Pageroute to guide users through setting up their profiles, so I'm assuming the appropriate MySQL table is 'profile_fields' (the weights can also be adjusted via 'admin/user/profile'). I even tried assigning the whole profile form a weight of -10 via a custom module, but to no avail.

EDIT: The custom module trick worked! In my first attempt, I left out the fieldset title (in my case, it's 'My profile'):

function modify_forms_form_alter(&$form, $form_state, $form_id) {
    switch ($form_id) {
        case 'user_profile_form':
            if(arg(0) == 'wizard'){
                $form['My profile']['#weight'] = -10;
            }
    }
}
brei9000’s picture

Thank you white_pawn! That worked for me!

One part that confused me... what is below - 'wizard' - referring to?

if(arg(0) == 'wizard'){

If I comment that line out (and the corresponding end bracket) it works great.

charles.holtzkampf’s picture

Hi All,

Im having problems applying the code above.

I have the following:

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

case 'profile_node_form': \\I use content profile, so I changed this to reflect that
if(arg(0) == 'registration'){ \\I assume this is the path set on your route ?
$form['profile']['#weight'] = -10; \\ Not sure what I put here. I changed this the name of my content type

Any help would be appreciated

charles.holtzkampf’s picture

Ive changed the below,

function pageroute_buttons(&$form, $form_state, $form_id) {
    switch ($form_id) {
        case 'profile_node_form':
			if(arg(0) == 'registration'){
				$form['Personal Info']['#weight'] = -10; //This is set to the GROUP CCK fieldset, is that right  ?
			} 
      }
}
Anonymous’s picture

Hi all,

Well, I am sure that the above "insiders" solutions may seem fine to some, but they are not satisfactory to me.

The fact of the matter is that Drupal's standard "save", "preview", etc. buttons appear in the proper place, always. Namely below the entire body of content it pertains to. That should be the same here, for pageroute's buttons.

I am sure someone can get this working properly, off-the-shelf. Nobody should have to go to the DB and/or run custom PHP code to get this behavior right.

IMHO.

Best to all,

Bob

FooZee’s picture

well, #8 worked, but this has to be done for each page on ur route ! so I strongly support #12

@brei9000 if (arg(0) == 'ur_route_path'); helps u only apply the following edits (changing #weight) to ONLY the page rout, protecting the other forms with the same $form_id !

_vid’s picture

Thanks to namtih58 #4 for identifying the issue.
I wanted to point out that you can work around it without mysql DB changes or custom php modules.

Simply disable js and then edit the field weights in your content type.

Steps:
Navigate to your content type and manage fields: (Administer > Content management > Content types > Your_Content_Type > Manage Fields). Sample URL: /admin/content/node-type/CONTENT_TYPE/fields

Now disable javascript and reload the page. Now you'll see the 'weight' field exposed.
Update all the weights to negative numbers and the pageroute buttons will show up at the bottom of the form.

Personal work flow note: I use the QuickJava Firefox extension to disable/enable javascript quickly.

There's a patch under review here: http://drupal.org/node/829170#comment-3523396 which appears to move the buttons to the bottom by default (weight: 200).

arvindkumargupta’s picture

Hi,

I was facing the same issue in Drupal 7 and I used the field weight module to resolve this issue.
http://drupal.org/project/field_weight

Thanks