Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
This module is greatly useful for a number of reasons, but I often find myself wishing I had more WWSGD blocks. I would love for a configurable number of blocks to be available.
The only real difficulty in making this possible is figuring out where to store the text value of each block. I think the best solution would be using a variable like variable_get('this_variable_'. $value, 0);
where $value was the numeric value of the block that needed to be shown. I could probably help if necessary but I'm pretty limited with time right now.
Comments
Comment #1
sillygwailoComment #2
sillygwailoI'm making a 2.0 branch for this feature, still under development. Still work to be done on it, but the skeleton is in place if you check out DRUPAL-5--2 in CVS.
Comment #3
IceCreamYou CreditAttribution: IceCreamYou commentedCool. I like where this is going. I have a couple comments on the code:
In hook_block() under the 'save' op, this:
should be simplified to this (also you need single quotes around the %s or it's a security hole):
In the submit handler for the "confirm delete" form, you should return the destination instead of using
drupal_goto()
.Instead of
drupal_map_assoc(array(1,2,3,4,5,6,7,8,9,10))
I would usedrupal_map_assoc(range(1, 10))
.Other than that, what you've got looks good. Looking forward to it!
Comment #4
sillygwailoThe design of the block admin function is a little strange (I know, I wrote it), so I'm going to hold off on that change. The other simplification changes are committed, though.
Comment #5
sillygwailoComment #6
sillygwailoIn D7, hook_block_view_alter() or hook_block_info_alter() could conceivably let WWSGD modify any existing block's visibility depending on a counter.
Comment #7
mgiffordWorth looking at how to do that. Would be quite interesting to be able to have a few welcoming blocks.