In Views we can create a block that the content depends on the content of a node using contextual filters. So we can pass variables and check the visibility of the Views-Block.
Let’s say in our content type we have a field that has a text-field. In Views->Contextual->Our field->Provide default value-> content ID from URL can grab this.
But creating a block programmatically
hook_block_view($delta = '') {
…
$block['content'] = theme('item_list', array(
'items' => ???,
'type' => 'ul',
));
…
}
How we can grab these values form the node-field?
And if there are no values how we will hide the block?