I have a block value which I need to access in a views row design template. I need to check the value of the block content in this template.

Does anyone know how?

1 Answer 1


You can use the following code.

$block = block_custom_block_get($block_id);
$content = $block['body'];

But be advised that it would generally contain html which would be difficult to parse.

If you are looking to store a value and then use it to check in the theme layer I would suggest creating an admin page for that and storing the value in the variables table, which you can later access by

variable_get('my_setting', 3);

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.