Home
Nested collections in one widget: shared collections, collections that contain shared collections, collections with embedded collections, and a widget with embedded collections
One widget renders every nested-collection case on this page. - Shared collections: collections that are shared so other collections and widgets can reuse them. - Collections that contain other shared collections: a collection whose contents are those shared collections. - Collections that have embedded collections: a collection with collections embedded inside it. - A widget that has embedded collections: the widget embeds collections directly, along with the cases above. All four show up in that single widget. Collection names and what to look for in the render can be filled in here once they exist.

Widget name: widget with shared and embedded nested collections

Back

How is this widget called

This page loads one widget by its published key. The collections and their text are stored in the widget, so the call does not pass placeholder values or per-component props.

libraries loads the source components that draw the widget. fetchOptions uses cache: "no-store" so each request reads the current widget instead of a cached copy.

The token is read from RULECMS_PRODUCTION_TOKEN on the server. Its value is not shown here.

TSXRead only
1<RuleCMSWidgetServer
2  token={process.env.RULECMS_PRODUCTION_TOKEN}
3  publishedKey="b35446f1-4661-4194-af57-6ec87a7b94b7---widget-936fbde7-8481-44f8-9790-51f9b98a84f5"
4  libraries={{
5    default: () => import("@rulecms/source-components-react"),
6  }}
7  fetchOptions={{ cache: "no-store" }}
8  errorFallback={<p>This widget could not be loaded.</p>}
9/>

This widget has a list of shared and embedded collections

C0
Simple shared collection. Nothing embedded in it!

When anything changes for this collection and it is published separately, it updates across the board.
E0
Simple embedded collection with different texts for different embeds
This is embed 1
E1
Simple embedded collection with different texts for different embeds
This is embed 2
C1
Shared collection. Embeds C0, E3 and E4 within it.

C0 is a shared collection, while E3 and E4 are embedded collections within it.

Below here, you should be seeing the shared collection C0. Whenever C0 changes it reflects below as well.
E3
Simple embedded collection with different texts for different embeds
If you are seeing this part of the text then it is not embedded. Delete this line to prove it is embedded
C0
Simple shared collection. Nothing embedded in it!

When anything changes for this collection and it is published separately, it updates across the board.
E4
Simple embedded collection with different texts for different embeds
If you are seeing this part of the text then it is not embedded. Delete this line to prove it is embedded