https://github.com/netlogix/netlogix.assetmetadata
Attach metadata objects to Neos Assets
https://github.com/netlogix/netlogix.assetmetadata
assets media metadata neos neoscms
Last synced: about 1 year ago
JSON representation
Attach metadata objects to Neos Assets
- Host: GitHub
- URL: https://github.com/netlogix/netlogix.assetmetadata
- Owner: netlogix
- License: mit
- Created: 2021-08-02T08:07:35.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2023-11-20T11:09:54.000Z (over 2 years ago)
- Last Synced: 2025-03-19T23:45:39.494Z (about 1 year ago)
- Topics: assets, media, metadata, neos, neoscms
- Language: PHP
- Homepage:
- Size: 38.1 KB
- Stars: 0
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Netlogix.AssetMetadata
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
1. Create a new Model with your desired properties that extends `Netlogix\AssetMetadata\Domain\Model\AssetMetadata`
2. Configure the metadata:
```yaml
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/.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'
```
3. Create the edit partial:
```html
Field A
```
4. Set the metadata `$asset->setMetadata('mymetadata', new MyMetadata('mymetadata', $asset))`
5. Get the metadata `$asset->getMetadata('mymetadata')`