Trying to get and display a scrapbook item via a tool file

Permalink 1 user found helpful
I'm successfully matching a db field to a tool argument to get the bID and the block object for the matching block, but when I try to render it I'm getting

Fatal error: Call to a member function getCollectionID() on a non-object in /home/bhdev/public_html/concrete/libraries/block_view.php on line 218


Likely because I'm in a tool context without a page to render to. Is there a way to render the output without a page object without having to write a custom function within that block controller to duplicate the output of the view?

aghouseh
 
aghouseh replied on at Permalink Reply
aghouseh
Answering my own question with the help of a colleague so that anyone who might run into this will have some direction.

$bv = Loader::library('concrete/block_view');
$bv = new BlockView();
$bv->render($block,'scrapbook');

This website stores cookies on your computer. These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media. To find out more about the cookies we use, see our Privacy Policy.