Add express_entry_list block programmatically to single page

Permalink
Hi,

I have single page where I want to render the express_entry_list block with different templates.
I already have the templates and when I add the blocks in edit mode I see exactly what I want.

But I think it's better to add these block programmatically since they shouldn't be removed or edited on this page.

The problem is that I don't know how to tell the block which express data object it should use.

For now I have the following:
$bt_baClubsFilterChecks = BlockType::getByHandle('express_entity_list');
$bt_baClubsFilterChecks->controller->exEntityID = Express::getObjectByHandle('members');
$bt_baClubsFilterChecks->render('templates/filter_checks');


But this leads to the following error:
Whoops \ Exception \ ErrorException (E_WARNING)
Creating default object from empty value

Thanks a lot for any help in advance.

Best Michael

MichaB