Posted by jdidelet on November 18, 2010 at 7:41am
Hi,
Anyone knows how we can set blocks_roles properties in code? I mean, I want to set in code (in hook_block ?) the properties about the role specific visibility.
Thanks !
Hi,
Anyone knows how we can set blocks_roles properties in code? I mean, I want to set in code (in hook_block ?) the properties about the role specific visibility.
Thanks !
Comments
In hook_block() with $op ==
In hook_block() with $op == 'view', you can manually check the permission or something else, then insert (or not insert) anything into $block['subject'] and $block['content']. E.g. check user permission with user_access().
Edison Wong
CEO, Co-founder
PantaRei Design Limited
Thanks for your help. Yes I
Thanks for your help. Yes I think it's the best solution.
Julien Didelet
Founder
Weblaa.com
What about Drupal 7 Block
Guys,
Its works for drupal 6 and what about drupal 7 block_roles rather than doing it by db_update to {block_roles} table.
Kindly let me know your feedback.
Regards,
Venkat