Datasources and Rendering Parameters: Building Flexible Sitecore Components
Sitecore components get their information from two places: datasources (content) and rendering parameters (presentation options). Getting this split right makes components reusable and editors happy.
Datasources = Content
A datasource is an item that holds the component's content — e.g. a Promo item with headline, text, image, and link.
- Datasource template — the allowed template for the component
- Datasource location — where editors pick or create datasources (local page data folder or shared folder)
Local vs. Shared
- Local (
Page/Data) — content specific to one page - Shared (
Site/Data/Promos) — reused across many pages; edit once, update everywhere
Rendering Parameters = Presentation
Rendering parameters control how a component looks:
- Background colour
- Layout variant (left image / right image)
- Number of items to show
- Show/hide elements
They're set per component instance, not stored in the content.
Rule of Thumb
| Content (datasource) | Presentation (parameters) |
|---|---|
| Headline, body, image | Theme, alignment |
| Link and CTA text | Spacing, size |
| List of items | Number of columns |
Headless Rendering
In JSS / Content SDK, datasource fields arrive as fields and parameters as params on the component props.
export const Default = ({ fields, params }) => (
<section className={`promo promo--${params.theme || 'light'}`}>
<Text tag="h2" field={fields.headline} />
</section>
);
Content in datasources, styling in parameters. Mix them, and reuse becomes impossible.