0

I have a multipage Webform that lives at a single URL and I would like to place certain blocks depending on which page the Webform is on.

None of the webform hooks give access to page number, and the only way to do so seems to be through a hook_form_alter which afaict is a bit late in the page build to pass information to other modules like Views and Context.

Any ideas how this might be achieved?

1

This is currently not possible through the default UI due to the URL of all webform pages being the same.

There are two possibilities as far as I know.

(1) If your blocks only show help texts or any other static information, you should probably not use blocks at all but add markup components and place them after each page break.

(2) If you are indeed using dynamic blocks (e.g. coming from views), you would need to create a custom theme file (e.g. webform-form.tpl.php) in which you may enter the logic defining which block should appear. The currently viewed page number of your webform should be available through $form['details'].

  • Thanks. The blocks are indeed dynamic. Is certainly looking like templating and pre-processing are the only ways to achieve. – pau1_m Jul 14 '14 at 15:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.