Block System Fixes

This commit is contained in:
Julian Prieber 2024-06-22 17:58:26 +02:00
parent e70ca58ec2
commit 11a7c66be5
2 changed files with 7 additions and 4 deletions

View File

@ -26,12 +26,9 @@ class LinkTypeViewController extends Controller
$data['button_id'] = $link->button_id;
}
// Check if type_params is not empty and is a valid JSON string
if (!empty($link->type_params) && is_string($link->type_params)) {
// Decode the JSON string into an associative array
$typeParams = json_decode($link->type_params, true);
if (is_array($typeParams)) {
// Merge the associative array into $data
$data = array_merge($data, $typeParams);
}
}
@ -46,9 +43,11 @@ class LinkTypeViewController extends Controller
'selected' => ($linkId && isset($link) && $link->button_id == $btn->id),
];
}
return view('components.pageitems.predefined-form', $data);
}
// Set the block asset context before returning the view
setBlockAssetContext($typename);
return view($typename . '.form', $data);
}

View File

@ -2,6 +2,10 @@
@section('content')
@push('sidebar-stylesheets')
<script src="{{ asset('assets/external-dependencies/fontawesome.js') }}" crossorigin="anonymous"></script>
@endpush
<div class="conatiner-fluid content-inner mt-n5 py-0">
<div class="row">