Good day everybody,
I’m using vuejs3 for my frontend deployed with npm. So I was wondering if there is a way to “inject” the actual concrete file manager in my frontend?
// this is the file manager I meant:
$alh = $app->make(‘helper/concrete/file_manager’);
$alh->file($inputID, $inputName, $chooseText, $preselectedFile = null, $args = []);
//
One solution we found was to render the file manager on the PHP side, which is also where the Vue script is rendered. And connect from the spa using a mutation-observer + triggers.
There are two parts to the file manager. There is the in-Dashboard backend file manager, which is actually not a Vue JS app at all - it’s a pretty traditional series of PHP pages with backend controllers. There is some light JavaScript but it’s not a component.
By contrast, the frontend file picker component is definitely a Vue JS component. If you want you to integrate the concrete file picker into your custom Vue application I would try something like the following (note: these examples use the user input but the principals are generally the same)
Make sure your custom application uses @concretecms/bedrock as a dependency.
In your custom Vue application, import the component:
import ConcreteUserInput from '@concretecms/bedrock/assets/cms/components/form/ConcreteUserInput';
Within the template of the Vue application, reference the component with its props: