media-ui
media-ui copied to clipboard
Custom Properties?
Hi,
is there a way to add custom properties to the asset view and make them editable?
I'm extending the Assets with a trait and need to make the properties changeable through the backend.
<?php
use Doctrine\ORM\Mapping as ORM;
trait AssetTrait
{
/**
* @var string|null
* @ORM\Column(nullable=TRUE)
*/
protected ?string $someProperty = null;
/**
* @return string|null
*/
public function getSomeProperty(): ?string
{
return $this->ePaperUri;
}
/**
* @param string|null $someProperty
* @return Audio|AssetTrait|Document|Image|Video
*/
public function setSomeProperty(?string $someProperty): self
{
$this->someProperty = $someProperty;
return $this;
}
}
and the asset models
<?php
/** @Flow\Entity */
class Image extends \Neos\Media\Domain\Model\Image
{
use AssetTrait;
}
<?php
/** @Flow\Entity */
class Audio extends \Neos\Media\Domain\Model\Audio
{
use AssetTrait;
}
<?php
/** @Flow\Entity */
class Document extends \Neos\Media\Domain\Model\Document
{
use AssetTrait;
}
<?php
/** @Flow\Entity */
class Video extends \Neos\Media\Domain\Model\Video
{
use AssetTrait;
}
No, there is no extensibility yet that would allow this.
I could imagine the possibility of a custom asset editing dialog that can be triggered in the asset list, and would allow this mechanism outside of the React and GraphQL flow, which then could be customised.
Something like this has been asked a few times now, also with storing the data in the content repository, but so far no sponsoring for feature has been made available.