media-ui icon indicating copy to clipboard operation
media-ui copied to clipboard

Custom Properties?

Open erkenes opened this issue 4 months ago • 1 comments

Hi,

is there a way to add custom properties to the asset view and make them editable?

Image

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;
}

erkenes avatar Sep 09 '25 11:09 erkenes

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.

Sebobo avatar Sep 15 '25 14:09 Sebobo