I want to render a Block on a special content type page and on the contact form page. All works fine, but i didn`t found any way to print the Block also on the contact form page.

i use in the page.tpl.php:

if(isset($node) && $node->type === 'page') {

Hope someone can help! Thx


Following the logic exactly as you have laid it out, you could test for

if (arg(0) == 'contact') 

to output the block on the contact page. However, is there a reason you're not using the block admin page to place this block instead? Other options here that might be easier to maintain would be:

  • place the block in the region you want using the Context module
  • copy the page.tpl.php file from your theme to page--contact.tpl.php and add your block content there
  • Hey, great thanks to you! I need the block twice, for the footer and for some content pages in one sidebar ... i hoped this was the easier way, but i didn`t found a solution for the contact page ... think yours should work! – Bruno Jul 7 '14 at 1:05

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.