Closed DGINXREAL closed 2 months ago
Ah i found it by myself.
$this->on('layout.components.collect', function($components) {
// Add a custom layout component
$components['video']['fields'] = array_map(function($field){
if($field['name'] === "attr"){
$field['opts']['options'][] = 'itsDginx';
}
return $field;
}, $components['video']['fields']);
$components['mycustomcomponent'] = [
'label' => 'My Custom Component',
'icon' => 'icon.svg',
'template' => '<div>{{ content }}</div>' // Custom HTML structure
];
ray($components);
});
Hello i'm new at Cockpit. I have some question about the Components/Layouts.
What is the correct way to edit existing components for the layouts?
And how can we add new components?
We want to provide all of this in an extra addon, that we can just install in different projects.
KR