Hello Community
I’m trying to make unify how images are uploaded and handled in our components. For that reason I’ve created a simple global structure:
"image": {
"values": [
{
"icon": "image",
"value": {
"imagePath": null,
"altText": null
}
}
]
}
I’m referencing it globally using:
"image": {
"label": "Hero Image",
"type": "object",
"options": {
"structures": "_structures.image"
}
}
with a base configuration for the imagePath:
"imagePath": {
"type": "image",
"options": {
"paths": {
"static": "",
"uploads": "src/prospect/assets/images"
}
}
},
Now in my bookshop components, I’d like to use the configuration cascade to have more specific configuration for the imagePath.
e.g. hero.bookshop.json:
{
"spec": {
"structures": [
"content_blocks"
],
"label": "Hero Header",
"description": "A component that renders a hero header",
"icon": "nature_people"
},
[...]
"preview": null,
"_inputs": {
"imagePath": {
"type": "image",
"options": {
"accepts_mime_type": [
"image/png",
"image/jpeg",
"image/svg"
],
"allowed_sources": [
"site-files"
],
"empty_type": null,
"resize_style": "crop",
"width": 580,
"height": 720,
"expandable": true,
"prevent_resize_existing_files": true,
"mime_type": "image/png"
}
}
}
}
and static-card-section.bookshop.json:
{
"spec": {
"structures": [
"content_blocks"
],
"label": "Static Card Section",
"description": "A section for static cards ",
"icon": "cards"
},
"blueprint": {
[...]
},
"preview": null,
"_inputs": {
"cards": {
"type": "array",
"icon": "cards",
"options": {
"structures": {
"style": "select",
"values": [
{
"label": "Card",
"icon": "cards",
"value": {
"title": null,
"description": null,
"image": null
}
}
]
}
}
},
"imagePath": {
"type": "image",
"options": {
"resize_style": "crop",
"width": 400,
"height": 300
}
}
}
}
Afaik the configuration cascade should merge these definitions, but it doesn’t look like. Only the globally configured settings are taking place here.
As I workaround I tried to duplicate the code and specify the _inputs and _structures only in the <component>.bookshop.json files, but I wasn’t successful with that either. Then the options for resize and the upload paths had no effect at all.
What am I missing here?
Best
