This is a unique situation, I guess, but here's what's happening...

I have the Gallery module installed, and it's a bridge between Drupal and Gallery2. The Gallery Grid Block has a lot of options and I use it show show the latest images in each of three albums I have in Gallery2. What I want to do is to create a total of three instances of the Gallery Grid Block and configure each of them to display the latest image in one of the albums. To do this, the Gallery Grid Block uses a field called "Album or Item ID". You specify the album and it will display the latest images only from that specific album. When I create new instances, all three of the instances use the same "Album or Item ID". If I change it in one, it changes it in the other instances too. Is there a way to prevent this?

Comments

andrewlevine’s picture

Eric,

I'm pulling this from the README. Hope it helps:

DEVELOPING MULTIBLOCK-ENABLED BLOCKS:
Multiblock should successfully clone any regular block created with
hook_block. However, if you clone a regular block that implements a
save or configure $op of hook_block, the custom block settings of
one block instance will overwrite the settings of another. To get
around this, you can make a block "multiblock enabled". To do this,
you have to first add an $op to your hook_block called 'mb_enabled'.
It should always return the string 'mb_enabled'. Once you do this,
the instances you create will get the block instance ID passed
in the $edit variable for the view, configure, and save $ops. This
will let you save and load different data to different instances
based on this instance ID. It is passed in with the
'multiblock_delta' key with the following format:
$edit['multiblock_delta'] = array(
'#type' => 'value',
'#value' => $block_id
);

ericinwisconsin’s picture

Thanks, Andrew! That did the trick.

Regards,
Eric

andrewlevine’s picture

Status: Active » Closed (fixed)

Glad it helped