Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I would like to see a way to navigate in a multipage edit form. Right now I can only see previous and next as ways to get around. Similar to this http://drupal.org/project/multistep but this module is in dev and has not been updated in a couple of years.. Has anyone come across anything like this? I did try the multistep module, but kept getting a lot of errors.
Comment | File | Size | Author |
---|---|---|---|
#1 | scrren.png | 63.95 KB | 8bitplateau |
Comments
Comment #1
8bitplateau CreditAttribution: 8bitplateau commentedhi,
I've added a little jquery snippet in my themes js like so :
i am using my own bootstrap theme though and have themed the multipage.js function
so that it gets bootsrtap styling.
the page nav gets rendered in a bootsrtap button group.
it also scrolls to top and you can stick it anywhere.
probaly will not work for you stratight away as i have differnet selectors but a good place to start
Comment #2
xbrianx CreditAttribution: xbrianx commentedHi, thanks for your reply.. I've been trying to figure this out now for quite a bit here, and still having some problems.. I created a file in my themes directory js called multipage-nav.js and calling the script in the theme.info file and then cleared the caches.
The script is being called on the page, so i know that is ok, but the navigation didn't show up. After a bit of research, i found that with drupal jquery scripts need to be wrapped inside:
I thought this should be the answer but alas after clearing caches and refreshing with the revised script it still didn't work. So I am not quite sure what to do now.
Comment #3
chrisolof CreditAttribution: chrisolof commented@xbrianx: Check out the "behaviors" section of this page:
http://drupal.org/node/756722
Comment #4
xbrianx CreditAttribution: xbrianx commentedThanks chrisolof, even though I am not sure what I am doing, I was able to get it to work after looking through that document and taking a look at the code of some other modules.
what I ended up needing was to add the bit of code for the behaviors, I went with
Then used the provided code from digitisation.
Now I have the navigation showing up.
Comment #5
8bitplateau CreditAttribution: 8bitplateau commentedbetter .. don't use 'undefined'
with ...
Comment #6
xbrianx CreditAttribution: xbrianx commentedThanks for the update on this; It would be great if this functionality became part of the multistep module itself in future versions, as it is extremely helpful.
Comment #7
8bitplateau CreditAttribution: 8bitplateau commentedi agree, but as well as 'jump to step' I have also added 'save and continue' functionality.
this is utilising some JavaScript that is already present in the multipage.js that allows you to jump to step using a link with a fragment where the fragment is the ID of the field-group, not sure if this is left over from the accordion display mode's js as some of the code looks similar.
so all i did was add an extra button in a form_alter with its own submit function to execute the form and set the destination to reload the same page with a fragment appended but ... #hashes (anchors / fragments or what ever you wanna call them) are client side and are not present in the executed $form array so I added an extra hidden element in the form and used javascript to write the ID of the current step (fieldgroup) to it. heres how.
oh, and this is on user entity not node by the way
1) shuffle around saves in form_alter and add new button
2) the actual submit function
3) the hacked jquery snippet from multipage.js
4 ) and dont forget to add a new form elemet either in form_alter of profile entity ui (account settings fields)
my user profile form is pretty large, its for a CV, and losing data really annoys people.
'jump to step' and 'save and continue' are two functions I put in that massively increased usability, the users were very happy about it.
lots of this code is in the module already, perhaps its coming in soon ??
this would also be written a lot better by the modules developers rather than me hacking around ;)
Comment #8
kaareI have a sandbox module that solves this: Multipage jumplist.
It creates a list of all panes/pages in a block, somewhat similar to Multistep module, minus the progress bar.
Unfortunately it only works for node edit forms, but if there is interest for it, I'll make it more flexible.
Also, bumped the version to 7.x-1.x-dev.
Comment #9
marameodesignHi Kaare,
Thank you so much for the module. I am using it and so far not an issue!
Thanks again!
Comment #10
djschoone CreditAttribution: djschoone commentedKaare: great module! Thnanks for the effort.
Comment #11
kaareBumped the sandbox to a full project: https://www.drupal.org/project/multipage_jumplist
So one suggestion to close this issue is simply to provide a link to Multipage jumplist on the project page under Modules that depend on fieldgroup.
Comment #12
ikeigenwijs CreditAttribution: ikeigenwijs commentedyes add to the project page