1

made a simple thankyou page (e.g. /product/3/thankyou) based on a menu callback in a custom module. the content shows up fine in the normal page layout but i want the regions and blocks to show up and they don't. suggestions?

// menu callback
function custom_menu() {
  $items = array();
  $items['product/%/thankyou'] = array(
      'page callback' => 'custom_product_thankyou',
      'access arguments' => array('access content'),
      'type' => MENU_CALLBACK
   );
  return $items;
}

// theme function
function custom_theme() {
  return array(
    'product_review_thankyou' =>  array(
      'variables' => array('node' => NULL),
      'template' => 'product_review_thankyou',
    ),
  );
}

// page callback
function custom_product_thankyou() {
  $node = node_load(arg(1));
  $output = theme('product_review_thankyou', array('node' => $node));
  return $output;
}
aterchin
  • 39
  • 4

2 Answers2

1

I just tried your code in a drupal installation and i have no issues with missing blocks. Is it possible that you configured your blocks to be displayed only on certain pages?

Nebel54
  • 1,308
  • 1
  • 10
  • 10
  • Half right, but you pointed me in the right direction. There _were_ blocks showing up on the page (which i didn't know were blocks, set up by another dev i work with). But the particular one in question was still not showing. – aterchin Dec 19 '11 at 15:50
0

The one block that i still couldn't get to show up (no matter what the block visibility settings were) was a 'menu block'. Problem was there wasn't a link for the thank you page in this block. So, I ended up having to add links on the configuration page with paths like product/[node_id]/thankyou, and then I disabled the links so they wouldn't be visible. Refreshed the page, and the block appeared.

To me this is a little annoying, as I kind of wanted this to be dynamic and not have to write in the product node ids. But either way, problem solved.

aterchin
  • 39
  • 4