I am using version 8.5.9 of ConcreteCMS. I would like to extend editing the block by using tools, so clicking on a button calls up for example, my_block/tools/edit_form_tool.php. I created the URL with this:
use Concrete\Core\Application\Service\Urls;
$URLHelper = App::getFacadeApplication()->make(Urls::class);
$formAddTreeTypeUrl = $URLHelper->getBlockTypeToolsURL($bt) . '/edit_form_tool';
And the bootstrap modal using the file manager:
use Concrete\Core\Support\Facade\Application as App;
$form = App::getFacadeApplication()->make(Concrete\Core\Form\Service\Form::class);
$al = App::getFacadeApplication()->make('helper/concrete/asset_library');
?>
...
<div class="form-group row">
<?= $form->label('image-tool', t('Image'), ['class' => 'col-sm-3']) ?>
<?= $al->image('image-tool', 'fID', t('Choose Image'), null) ?>
</div
...
It looks like the filemanager.js is working, as I can see this in the inspector:
<script>
$('[data-file-selector="image-tool"]').concreteFileSelector({"inputName":"fID","fID":null,"filters":[{"field":"type","type":1}],"chooseText":"Choose Image"});
</script>
but there is no input, so the inner HTML (chooseTemplate
) is not being created:
<div class="ccm-file-selector-choose-new">
<input type="hidden" name="fID" value="0">
Choose Image
</div>
Could anyone help me understand what I am missing or what I need to do to get the helper to function correctly? Thanks