Hi I need an if statement around a div in page.tpl to only include it on certain pages, but instead of saying If the url is "value" is there a better way to do this? Like for instance using a boolean and defining it as true on the pages I want the div to appear.

I'm not sure how best to do this?

Comments

DGvNp0niToyRspXaaqx3PiQBMn66QXyAq5yrNHpz’s picture

Getting your block on the page

Depending on what you need exactly, it sounds like what you need is a region that you can insert a block into. See http://drupal.org/node/171224

Displaying your block on specific pages

Option 1
Once you have a new region defined you can use the built-in block PHP filter to check a value and return boolean, either showing or hiding the block. See http://drupal.org/node/60317

Option 2
You can also use the Context module that will allow you to display a block or other element on a page dependent on a variety of default options including menu, node type, taxonomy, path, use role, user pages, or views. See http://drupal.org/project/context

If you have a more specific use case, I could give more detailed instructions.

joe huggans’s picture

I am using jscrollpane and dont want the div which it is assigned to to be present on certain pages as it doesn't extend downwards correctly with added content, so I need to hide it on these pages