1

I have created a View page, and added a "Global:PHP" field to embed a View block from another View using the following code:

<?php  print views_embed_view('VIEW_NAME','VIEW_BLOCK_NAME', $data->tid);?>

Now, it worked perfectly, but there's no detail or variables I can find in the print_r($data)/dsm($data) about this View block's content.

My purpose is that, if there's no result in view block, then I will hide a particular custom field. In short, "if views_embed_view() return empty then hide field A

Wondering how to go about it. Please advise. Thanks!

1

I would instead use views_get_view_result() if all you are concerned with is if there is a result. More information on it can be found here.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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