netlogix / assetmetadata
There is no license information available for the latest version (2.2.0) of this package.
Attach metadata objects to Neos Assets
Package info
github.com/netlogix/Netlogix.AssetMetadata
Type:neos-package
pkg:composer/netlogix/assetmetadata
2.2.0
2025-05-13 08:02 UTC
Requires
- neos/media: ^7.3 || ^8.3
- neos/neos: ^7.3 || ^8.3
- neos/utility-arrays: ^7.3 || ^8.3
README
This package allows you to attach multiple metadata objects to an asset.
Assets are automatically given the Netlogix\AssetMetadata\Domain\Model\AssetMetadataAwareInterface using an Aspect, so you can simply call $asset->getMetadata('myMetadata').
Configuration / Usage
- Create a new Model with your desired properties that extends
Netlogix\AssetMetadata\Domain\Model\AssetMetadata - Configure the metadata:
Netlogix: AssetMetadata: metadata: 'mymetadata': label: 'My Metadata' # Class that implements this Metadata. Must extend AssetMetadata className: 'My\Metadata\Domain\Model\MyMetadata' # Partial root path that contains the edit partial editPartialRootPath: 'resource://My.Metadata/Private/Partials' # Partial File to render in Asset Edit View # Path must be Package/Resources/Private/Partials/AssetMetadata/<editPartialName>.html editPartialName: 'MyMetadata' # Neos AssetSource identifiers to which this Metadata configuration should apply # If this is unset, the Metadata will be applied to all AssetSources assetSources: ['neos', 'my-special-asset-source'] # Optional position for ordering in the Edit View of an Asset position: 'start'
- Create the edit partial:
<label for="mymetadata-fieldA">Field A</label> <f:form.textfield property="{metadataPropertyPath}.fieldA" id="mymetadata-fieldA" placeholder="Foo" type="text"/>
- Set the metadata
$asset->setMetadata('mymetadata', new MyMetadata('mymetadata', $asset)) - Get the metadata
$asset->getMetadata('mymetadata')