That would be the general kind of code you want to use. What file is it from? Or what tutorial/post/etc?

$current_page_base will hold a value like 'index' or 'product_info' or 'contact_us', nothing more or less. There are other variables that hold other information you may want to use.

Some sideboxes (the top two in the right column) will not need to have any restrictive coding, since there will always be space to display them. The third sidebox will be restricted in only a few cases, while the ninth sidebox will be restricted in most cases.