There might be another way of solving this than combining 2 list into one but right now I think I need to merge it so I only get one group of []
I am using a Grid field so I have have a heading above my lists. For example a recipe instruction where I want add "Filling" before a list of instructions and then "Pastry" before another list of instructions.
Here is my fieldset YAML.
instructions:
type: grid
display: Instructions
fields:
part:
type: text
display: Part
instructionlist:
type: list
display: Instructions
This is great as I can do this frontend for visitors:
Filling:
- blend
- cook
Pastry:
- mix
- bake
Great UI for the visitor (at least I think so) but now I need to build the JSON LD Microdata for Google and I dont want to let Google dictate that I cant add a heading (Filling & Pastry for example) and thereby splitting up my list but I am running into a problem as when using to_json modifier I am getting two (what the correct term?) groups of [""] as seen here:
["blend","cook"] ["mix","bake"]
Where I would like to only have
["blend","cook","mix","bake"]
Here is my frontend code
{{ instructions }}
{{ part }}
{{ instructionlist | ul }}
{{ /instructions }}
Here is what my to_json code
{{ instructions }}
{{ instructionlist | to_json }}
{{ /instructions }}
And here is the content from the MD file
instructions:
-
part: Filling
instructionlist:
- blend
- cook
-
part: Shortcrust Pastry
instructionlist:
- mix
- bake
I might be approaching is all wrong but after spending a long time looking at fieldset ideas and modifiers I have given up.
In case you are interesting in the CP view of the fieldset then here is a screenshot
Thank you in advance