Is there any way to determine which module has called a block? Specifically, I'd like to make a change such that certain blocks, when called, get a different title background color. The only way I can think of doing this is testing who's calling the block, then use a condition statement to change a CSS class (or similar).

Also, is there any way to determine if a box() has been called for a menuitem - or for a content item? I'd like to make box() menuitem regions a different background than the content box() regions. But sometimes a box() is used interchangeably, so I again would have to create a construct to test how the box() was called, to determine what to do.

Which ... begs another question ... how hard would it be to modify (and where would I?) the core so that when a menuitem calls a box() to render from the theme, to change it to call something like menubox()??

v/r
Shane

Comments

moshe weitzman’s picture

you can use debug_backtrace() on PHP 4.3 to learn what function called your function (and so on, all the way up the call stack).

erikhopp’s picture

i want to do the same thing. i was thinking that creating a new box function in your theme (and then calling it menubox or whatever) might work, but that would also require changing some of the core code (which, i guess, might have to happen anyway).

i don't know.

let me know what you find out, because i want to figure this out too.

ehopp@hampshire.edu