In older blocks we could use the interface helper, like the Add Image button in the old slideshow block did.

$ah = Loader::helper('concrete/interface');
$ah->button_js(t('Add Image'), 'SlideshowBlock.chooseImg()', 'left')

This doesn't work anymore in 5.7. You get an error with the Loader::helper('concrete/interface') it says "Class helper/concrete/interface does not exist". Then with just the button_js line the form does not load at all.

Is that interface helper gone in 5.7 or what needs to be done to make it work?

1 Attachment

View Replies:
mnakalay replied on at Permalink Reply
If you need an image selector you do this
$app = \Concrete\Core\Support\Facade\Application::getFacadeApplication();
$al = $app->make('helper/concrete/asset_library');
echo $al->image('ccm-b-image', 'fID', t('Choose Image'), $bf);

where fID will be the name of your input and $bf you existing (already selected) image object if any.

You can look at how it's done in the core image block for instance.