ohkannaduh
09/27/2021, 2:52 PMpublic function index($parentModuleId = null)
{
$response = parent::index($parentModuleId);
if (!$response instanceof View) {
return $response;
}
return $response->with('...', '...');
}pboivin
09/27/2021, 2:55 PMuser
09/28/2021, 1:05 PMopenMedia: () => {
if (window[process.env.VUE_APP_NAME].vm) {
console.log(window[process.env.VUE_APP_NAME].vm)
window[process.env.VUE_APP_NAME].vm.openFreeMediaLibrary()
}
}, and it works perfectly fine, but when i want to do it from a blade view , i get an error that process is undefined, i tried with window.TWILL.vm it says vm not workinguser
09/28/2021, 1:06 PMpboivin
09/28/2021, 1:25 PMuser
09/28/2021, 1:25 PMuser
09/28/2021, 1:26 PMpboivin
09/28/2021, 1:27 PMuser
09/28/2021, 1:27 PMuser
09/28/2021, 1:27 PMpboivin
09/28/2021, 1:28 PMuser
09/28/2021, 1:29 PMuser
09/28/2021, 1:29 PMuser
09/28/2021, 1:29 PMpboivin
09/28/2021, 1:30 PMuser
09/28/2021, 1:30 PM`Sebastlan
09/28/2021, 1:45 PMpboivin
09/28/2021, 1:47 PM`Sebastlan
09/28/2021, 2:06 PMhttps://i.imgur.com/8EYhKLu.png▾
`Sebastlan
09/28/2021, 2:06 PMhttps://i.imgur.com/w8mzfnk.png▾
ohkannaduh
09/28/2021, 2:42 PM{{-- @twillBlockCompiled('true') --}}
{{-- @twillBlockComponent('a17-block-currency-input') --}}
{{-- @twillBlockTitle('CurrencyInput') --}}
{{-- @twillBlockIcon('text') --}}
{{-- @twillBlockGroup('app') --}}
<a17-block-currency-input
name='{{ $name }}'
label='{{ $label }}'
in-store='value'
required
></a17-block-currency-input>
@if (isset($formData))
@push('vuexStore')
window['{{ config('twill.js_namespace') }}'].STORE.form.fields.push({
name: '{{ $name }}',
value: {{ $formData }}
});
@endpush
@endif
which is [views]/admin/blocks/currency-input.blade.php, it all works fine but I can't remove the comment group at the top or it breaks, If I uncomment them, they render as plain html. Is that intended?pboivin
09/28/2021, 2:55 PM@twillBlockComponent defines the component name for this template. So for example blocks/image.blade.php could use @twillBlockComponent('a17-block-image'). Here it looks like you are defining a block that should include itself. Or am I missing something?pboivin
09/28/2021, 2:59 PMconfig/twill.php ?ohkannaduh
09/28/2021, 3:11 PMblock_editor or just any block that you might re-use throughout your code. I had missed the definition in config/twill.php.
I dug through the Build command a bit and found there was some code in place for adding custom components and figured that might be more what I needed.pboivin
09/28/2021, 3:12 PMpboivin
09/28/2021, 3:14 PMohkannaduh
09/28/2021, 3:19 PMreturn [
...
'custom_components_resource_path' => 'js/twill/components',
...
];
- Created my vue component in resources/js/twill/components/CurrencyInput.vue
- Ran php artisan twill:build
- Created admin/components/currency-input.blade.php
- Referenced the component in there: a17-currency-input
That about achieved what I wanted. I also achieved this with the block registration before switching to the above.ohkannaduh
09/28/2021, 3:21 PMtwillBlockTitle('...')
Which I appear to have been confused to how they workpboivin
09/28/2021, 3:21 PMohkannaduh
09/28/2021, 3:22 PM