Part Data Loaders
To include structured part data in a page, create a dataSection using the existing structure at /home/dev/contents/api/business/semanticParts/dataSection.json, which contains a dataLoader through dataSection/dataLoader.json. Configure that loader in contents to retrieve the owning part’s data and include it in the page response. If dataSection is unsuitable, document the requirement and why the existing structure cannot support it in a file named warning at the root of the intended part, and request approval before implementing an alternative. Proceed with the alternative only after approval has been granted.
Philosophy
A standard dataSection composition keeps page data loading consistent while requiring explicit review of exceptions.
Correct
Events: Create a page dataSection using the existing contents structure and configure its dataLoader to load events.
Blog posts: Create a dataSection whose dataLoader supplies featured posts from the blog part.
Products: Create a dataSection whose dataLoader supplies selected products from the products part.
Incorrect
Events: Configure a standalone dataLoader instead of composing the page section with dataSection, without approval.
Blog posts: Introduce an alternative loading structure without documenting the need in the blog part’s root warning file and obtaining approval.
Products: Replace the configured dataSection with fetching inside a theme component without approval.
Fix
Create and configure a dataSection with its contained dataLoader. If it is unsuitable, write the need and reason in the intended part’s root warning file and obtain approval before implementing an alternative.