Is it possible to include a block (generated by a view) on only one of a multi-page webform?

The second page of the 3-page webform is an 'i agree to...' check button. I want to include the block only on this page of the webform.

If i use the context module and/or more specific block visibility rules, there is no distinction between pages in a webform.

Is there another way to achieve this?

Comments

robbiePie’s picture

I have a similar issue. I am trying to make a multipage form where the first page is in a block and the following pages are their own. Currently when I have it set up in a block the subsequent pages are in that block as well...

Bonus points if someone can tell me how I can choose from multiple forms based on a field selected on the first page. Some conditional logic, not sure where to put it. Thanks

quicksketch’s picture

Status: Active » Closed (duplicate)

To solve this issue, we should look into #335480: Set separate URL for each page of Multi-Page Forms (Funnel Tracking). Right now this is not a very feasible task.

jtwalters’s picture

Version: » 7.x-3.x-dev

A hack-ish way to accomplish this is to use PHP-code block visibility function:

Show block on specific pages: Pages on which this PHP code returns TRUE (experts only)

Example:

<?php
$node = menu_get_object();
if (isset($node) && $node->nid == REPLACE_NODE_ID) {
  return empty($_POST);
}
return false;
?>
bbc’s picture

Thanks for the code snippet. I've been trying to use $_POST['details']['page_num'] in a custom module to display a different block on each page of a form, but have found that the blocks only display correctly when users move forward through the form. When they use the back button, things get out of sync for a reason that I'm failing to understand.

Is there something about how $_POST variables get updated that's different when the previous vs. next page button gets activated?