I know what you mean, I would like that too.. but I understand why it hasn't happened. With so many conditions that effect the display of blocks already (user,anonymous,groups,language,etc) it would add yet another layer of complexity. Not to say it can't or won't be done someday, but I'm having trouble visualizing how it would be administered as well... the blocks acp really needs some UI improvements prior to attempting something like this, imo.
In the meantime you can create custom blocks that can change content in a variety of ways. This is just an example of some things that could be done.
Special content for block when using Your_Theme
Code:$ThemeSel = get_theme();
if($ThemeSel=='Your_Theme'){
// Special content for block when using Your_Theme
$content = 'Here is special content only when viewing with ' . $ThemeSel;
} else {
// Not Your_Theme
$content = 'All other themes get this :)';
}
|
Different block if both columns of blocks are visible
Code:if (defined('INDEX_FILE') AND INDEX_FILE===true) {
// Different block if both columns of blocks are visible
$content = 'Looks like both columns of blocks are visible!';
} else {
// Only a single column of blocks
$content = 'Only a single column of blocks can be seen!';
}
|
Special block when on the home page
Code:if (defined('HOME_FILE')) {
// Special block when on the home page
$content = 'Home Sweet Home';
} else {
// Not the homepage
$content = 'Nobody is home :(';
}
|
Module specific block
Code:$module_name = basename(dirname(__FILE__));
if ($module_name == 'Some_Module') {
$content = 'Hey this is Some_Module!';
} else if($module_name == 'Content') {
$content = 'Feeling Content';
} else if($module_name == 'Forums') {
$content = 'Hey it is the forums';
} else {
$content = 'Content for everywhere else';
}
|
This last one is more for sharing a block with others, as there is no way to dynamically switch columns. Useful when you need to do special stuff depending on the column location of the block.
Code:if (!isset($side)) $side = '';
if ($side == 'c' || $side == 'd' || $side == 't') {
$content = 'center block';
} else if($side == 'l') {
$content = 'left side';
} else if($side == 'r') {
$content = 'right side';
} else {
$content = 'unknown error';
}
|
These are basic examples, but you could certainly nest whatever code inside that you need, or modify/combine/addto the logic..