By tonyp001 on
I'm writing a module that interacts with Organic Groups. One thing I'm trying to do is create a block that appears whenever the "group" content type is shown. I would like for the block to appear when the user enables my module and disappear when its disabled.
I was thinking I could use the nodeapi and add the block when someone views the "group" content type, but I wasn't sure how to declare a block for a content type that wasn't my own...
Does anyone have any idea how this could be done?
Any help would be appreciated.
Thanks.
Comments
hook_block
Just use hook_block normally, but only load your block under certain conditions.
OG does this, so look at og_block() -- there is even some logic there for determining when you are viewing an OG page. See og_block_details(), for instance.
--
http://ken.therickards.com