You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
data:
# Object class to be used, allowing custom methods for the object
object: 'Grav\Common\Flex\Types\Generic\GenericObject'
# Collection class to be used, allowing custom methods for the collections
collection: 'Grav\Common\Flex\Types\Generic\GenericCollection'
# Index class to be used, works as a quick database-like lookup index
index: 'Grav\Common\Flex\Types\Generic\GenericIndex'
storage:
# Storage class, use single file storage (does not support images and assets)
class: 'Grav\Framework\Flex\Storage\FolderStorage'
options:
formatter:
class: 'Grav\Framework\File\Formatter\YamlFormatter'
options:
file_extension: '.yaml'
inline: 5 # Save with up to 4 expanded levels
indent: 2 # Indent with 2 spaces
native: true # Use native YAML decoder if available
compat: true # If YAML cannot be decoded, use compatibility mode (SLOW)
folder: user-data://flex-photos
Image storage works as expected, storing the photo in the "hashed" folder alongside with the photo.yaml file.
The problem is that no relative path is stored in the .yaml file, so attached image gets lost when editing back the object.
Generated item.yaml file:
when using relative path destination destination: user/data/flex-photos/files.
I haven't tried yet to build a directory to list photos, but I'm guessing it wouldn't work either, if I get a basic understandig of Grav Forms and Assets management.
Thank you!
The text was updated successfully, but these errors were encountered:
Not having a path is actually intended behavior for images located in the object itself. For example, on pages having a path basically causes images to break whenever the path to the page changes.
This is also true with a custom destination, the field always contains information about the path, so there's no real need to include it. However, editing the item should not cause the image to be lost, which sounds like a bug to me.
Thank you for the quick repilies.
Exactly. No issue in having relative path to the object itsef, but would it work as expected system-wide?
I'm afraid this also happens with user-data:// path, leading to a broken attachment path, if I recall correctly from another attempt with such attachment configuration.
Thank you.
Hello,
I'm trying to build a custom flex type
photos
here are the relevant code sections:data
section:Image storage works as expected, storing the photo in the "hashed" folder alongside with the photo.yaml file.
The problem is that no relative path is stored in the .yaml file, so attached image gets lost when editing back the object.
Generated
item.yaml
file:opposed to:
when using relative path destination
destination: user/data/flex-photos/files
.I haven't tried yet to build a directory to list photos, but I'm guessing it wouldn't work either, if I get a basic understandig of Grav Forms and Assets management.
Thank you!
The text was updated successfully, but these errors were encountered: