Hi,
I’m trying to figure out how to use the query for the color field in a block.
My goal is to let the user reuse colors they already used in another block.
It’s working fine in a page :
color:
label: Couleur
type: color
options:
type: query
query: site.find("projects").childrenAndDrafts.pluck("colors", ",", true)
After the user saved a page with a color, the other pages will suggest the color. As expected.
I’m not sure on how to access the data stored in a layout/block view though?
The data is stored in «carousel» in the site.txt
"Carousel":[
{
"attrs":[
],
"columns":[
{
"blocks":[
{
"content":{
"image":[
"file://Ues96CiXEE7gyS8Y"
],
"color":"#000dce"
},
"id":"39aa166a-273c-4497-9ffa-60b2604e18b4",
"isHidden":false,
"type":"customimage"
},
{
"content":{
"image":[
"file://0WqUHUO1qhIOXZMR"
],
"color":"#08ff00"
},
"id":"88608f69-3064-4b1f-85e2-b195edc98765",
"isHidden":false,
"type":"customimage"
}
],
"id":"10d145cc-c479-42cc-bbc2-71fa72f49110",
"width":"1/1"
}
],
"id":"bcb7246f-847f-439d-89aa-5fd71491b54f"
},
{
"attrs":[
],
"columns":[
{
"blocks":[
{
"content":{
"image":[
"file://bIClYBasbdTdwIjo"
],
"color":"#ad0000"
},
"id":"b4a4eabf-b383-4cfd-b875-4aa093faf271",
"isHidden":false,
"type":"customimage"
}
],
"id":"2980f9bd-d174-403a-b41d-fefae5c77dd9",
"width":"1/2"
},
{
"blocks":[
{
"content":{
"image":[
],
"color":""
},
"id":"f8891e91-07ca-4404-ba37-2634a9610218",
"isHidden":false,
"type":"customimage"
}
],
"id":"a03d69a6-8af9-4452-8ff1-1b0382f3a1e9",
"width":"1/2"
}
],
"id":"79a7fdc4-52a6-4db9-95f3-947300b8c0c3"
},
Thanks for the precious help.