File: D:/HostingSpaces/SBogers10/reiskick.komma.nl/app/Components/Types/ArticleSliderWithSide.php
<?php
namespace App\Components\Types;
use App\Components\ComponentTypes;
use App\Components\HasSpacingTrait;
use Komma\KMS\Components\ComponentType\Types\AbstractComponentType;
use Komma\KMS\Core\Attributes\Documents;
use Komma\KMS\Core\Attributes\Models\ImageProperty;
use Komma\KMS\Core\Attributes\TextArea;
use Komma\KMS\Core\Attributes\TextField;
class ArticleSliderWithSide extends AbstractComponentType
{
use HasSpacingTrait;
protected int $id = ComponentTypes::ARTICLE_SLIDER_WITH_SIDE;
protected string $name = 'article-slider-with-side';
public function defineAttributesAndTabs()
{
$this->addItems([
(new Documents())
->setReference('image')
->onlyAllowImages()
->setSubFolder('component_uploads')
->setMaxDocuments(1)
->setImageProperties([
(new ImageProperty())->setName('small')->setCropMethod(ImageProperty::Resize)->setWidth(400),
])
->setSmallDragAndDropArea(),
(new TextArea())
->setReference('text')
->enableTinymceEditor(),
(new TextField())
->setReference('button')
->setLabelText('Button')
->setExplanation('Wanneer link leeg is, wordt deze niet gebruikt.'),
(new TextField())
->setReference('link')
->setLabelText('Link'),
]);
$this->addItems($this->getSpacingFields());
}
}