You need to use a RowLayout (for stucture) and DropZones (for widgets) in your getPreview in order to get widget content in your structure mode preview.
Say you have this in your MyWidget.xml file:
<property key="complexContentLeft" type="widgets" required="false">
<caption>Content Left</caption>
<description>Place Widgets Here</description>
</property>
<property key="complexContentRight" type="widgets" required="false">
<caption>Content Right</caption>
<description>Place Widgets Here</description>
</property>
You will then want to do something like this in your getPreview:
{
type: "RowLayout",
columnSize: "fixed",
children: [
{
type: "Container",
borders: true,
grow: 1,
children: [
{
type: "DropZone",
property: values.complexContentLeft,
placeholder: "Place Widgets Here",
grow: 1, // Adjust based on your needs
} as DropZoneProps
]
},
{
type: "Container",
borders: true,
grow: 1,
children: [
{
type: "DropZone",
property: values.complexContentRight,
placeholder: "Place Widgets Here",
grow: 1, // Adjust based on your needs
} as DropZoneProps
]
}
]
}
That will give you something like this in structure mode:
Now you will be able to put widgets inside your widget from structure mode!