Apologies, similar issue to others eg http://drupal.org/node/285102 but were closed before a response could be given for he non-php literate amongst us. I have checked and double checked the read me and I think I have followed things fairly straighforwadly but I cannot get any block (using both latest dev and 6x 1.3) to go multiblock enabled. Including both already assigned and unassigned blocks. See screenshot.

I have also tried to follow the readme instructions to multiblock enable and have tried my best with the code suggestions eg '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'...etc

But I am not at all sure where this code is best placed in the module file. Could you spell things out for the non-php types like myself. Sorry to go back to basics. I do know the original delta is 4 ;)

CommentFileSizeAuthor
multiblock.gif7.1 KBchlobe

Comments

nancydru’s picture

Status: Active » Postponed (maintainer needs more info)

I just added an actual example to the handbook: Multiblock: an example.

Does that take care of it?

chlobe’s picture

Hi nancydru, thanks so much for being so prompt in replying, yes it does indeed help - would I be correct in assuming the block delta of 4 [my required multiblock] is inserted in line 1:

function taxonomy_image_block($op = 'list', $delta = <strong>4</strong>, $edit = array()) {

thanks again

nancydru’s picture

$delta is a parameter that is passed to you. It is used for determining which block to generate or configure. It is defined in the "op=info" call. http://api.drupal.org/api/function/hook_block/6

andrewlevine’s picture

chlobe, Just to be clear, a block does not have to be "MultiBlock enabled" to use Multiblock unless you are saving extra custom information for each block INSTANCE. If each of your blocks are identical except for all the regular (page visibility, weight, region) block settings, your blocks don't have to be MultiBlock enabled.

Does that help at all or was that already clear?

chlobe’s picture

andrew, I appreciate the extra clarification, it was clear but initially confusing because in previous versions (which may have actually been the other multiple block related module) there was no extra configuration required in enabling two versions of the same block that did differ in relation to custom content (unless I was dreaming it). My case is a work around as I am not adept enough at arguments and using a similar by terms block specific to a taxonomy to call a related node for two different content types.

Thanks again, I appreciate you taking the time to reply

Best

chlobe’s picture

Cheers NancyDru, thanks for the further clarification. I will report back.

Cheers

chlobe’s picture

Hi again NancyDru

This has got me completely stumped. I am completly off track to assume the required code goes into the module itself? I have tried various attempts but I actually have little to no idea of what I am doing. What modifications would I need to make to your suggested example code (linked above)?

Feel free to ignore the request as this is neither bug nor feature request but inept php knowledge.

nancydru’s picture

@chlobe: I like to help, so I won't ignore someone who is trying.

Yes, this requires changes to the module code. In the case that I documented, I am the module maintainer, so I accepted my own issue. If the module you are working with is your own, go ahead an make the changes; they are not all that difficult. If you are modifying someone else's module (such as a contributed module), I would recommend filing an issue requesting it, or, better yet, supply them a working patch. I have met very few module maintainers who look much more favorably upon a patch than just a request.

This kind of change should improve your PHP skills quickly.

chlobe’s picture

Status: Postponed (maintainer needs more info) » Closed (fixed)

Thanks for all the help NancyDru. Close this one. Head sore from banging against wall and time constraints have caught up with me.

Cheers