I have a couple of node types, policy, quote, customer etc and each of those has a set of actions called that are printed in a menu of links which are coded into the template file. I want to put this menu into a block so that I can reposition it, so the block needs to be dynamic.
I was going to just create a block in a module, and in the $block['content'] just foreach out an array of actions...but I can't find out how to firstly make those variables available to the block and secondly where to do so.
I looked at preprocess functions but I could only make out that they are for passing variables to the template rather than to a block. Does anyone have any suggestions here, otherwise it seems that blocks are just completely isolated?
The only other way I thought to do it would be to get the node Id from the arg() and load it, then a switch statement depending on the node type to add the actions - but that seems like a very messy and roundabout way to do it, especially when adding node types int eh future.