I am using someone else's theme on a very small site.

Specifically, I want to display blocks on specific pages. I am able to display blocks on only and on all pages except .

My understanding is that I should be able to display a block only on page "what-we-do" putting what-we-do where I put .

Alternatively I code put node/7 (this page being node/7).

The result is that the block is displayed persistently on the front page and on no others.

This is clearly nonsensical and either I am doing something very silly or I need to start reading through the code.

My question, precisely: has anyone encountered this problem before and can they suggest a way forward?

  • 1
    Could you provide a screenshot of your block configuration (admin/structure/block/manage/system/<block_name>/configure) – Watergate Dec 17 '14 at 0:00
  • And is it a contributed theme or something someone customised? – Darvanen Dec 17 '14 at 4:01
  • 1
    It seems page.tpl.php is override for home page. And the region in which you placed the block is not printed in any other template file except front page. – Sumit Madan Dec 17 '14 at 4:57
  • In addition to the other excellent advice given, have a look to see if you have any modules in there that could be overriding normal block behaviour, specifically something like Context. – J. Reynolds Dec 17 '14 at 5:14
  • MrWatergate - not sure what you are looking for there. Daraven - contributed theme with a very simple sub-theme - yes potential for error but minimal edits on the .info and .css. – jobucks Dec 17 '14 at 11:22

Sumit Madan was spot on. Several blocks were hard coded as front page only in the page.tpl in the contributed theme.

For other newbies caught out by hard coding, the cues are:

  • The visibility settings for a block behave erratically, i.e., in a pattern not consistent with your expectations
  • When you inspect the regions (/Structure/Blocks - at the top), some of the regions do not appear. Yet, you can put a block into them and the show up when you inspect under Firebug. Now I understand the problem, a quirk that had puzzled me is fully explained.

To find the hard coding in page.tpl, look for ($is_front) and change that to ($page != 0).

page=0 refers to pages like lists of taxonomies. So this edit means the relevant blocks will be available to all pages including the front page and can be managed using the block visibility as usual.

Thanks everyone.

| improve this answer | |

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.