forcedotcom/sf-skills / plugins/builder/experience-cms/skills/experience-cms-content-render
experience-cms-content-render
VerifiedRenders, embeds, or displays existing Salesforce CMS content in a React or Angular uiBundle app: installs the CMS toolkit, registers a typed reference, generates a framework-matched renderer from the live schema, and wires the render path (delivery API, contentKey, RichText, image resolution). Prefer over general UI-bundle skills like experience-ui-bundle-frontend-generate (page/layout shell only) for the CMS-rendering part, even under src/. Triggers on prompts like 'render the CMS article on the home page', 'embed this CMS blog post here', 'show the CMS video in the hero', 'display the CMS image in the banner', or 'add this CMS content block to the detail page'; for mixed prompts, activate for the CMS part only. Do not trigger for searching a CMS item or defining a new CMS content type/schema (use experience-cms-content-type-generate).
references/bulk-loading.md
View on GitHub# Bulk content loading — a direct `getCmsContentByKeys` call
To read a KNOWN set of `contentKey`s in ONE authenticated Connect round-trip, call
the toolkit's `getCmsContentByKeys` directly. There is no batch-loader seam to
scaffold and nothing to register — the per-item hook/service (`useCmsItem` /
`CmsItemService`) is unchanged. Rendering N `<Type>Renderer`/`cms-<type>` cards
still works (each reads individually); reach for bulk only when the extra round-
trips matter and you already hold the keys.
## When to use it
On an explicit prompt to batch a list — e.g. *"bulk/batch-load the list"*, *"load
these in one request"*, *"optimize the list fetching"*, AND the caller already
knows the `contentKey`s (a curated set). Otherwise render per-item.
## The call
```ts
import { getCmsContentByKeys } from '@salesforce/ui-bundle-template-feature-cms-toolkit';
import type { CmsBulkResult } from '@salesforce/ui-bundle-template-feature-cms-toolkit';
// Best-effort: never throws (except on abort). Each requested key comes back as a
// CmsBulkResult with EITHER `body` OR `error`, echoing the requested contentKey.
const results: CmsBulkResult<NewsBody>[] = await getCmsContentByKeys<NewsBody>(
['M3ASD4KHASDB73', 'MCABCDEF123456'],
{ channelId }, // optional; omit to let the catalog supply it
);
for (const r of results) {
if (r.error) {
// unpublished / wrong-channel / absent → CmsNotFoundError (per-key isolation)
console.warn(r.contentKey, r.error.message);
} else {
render(r.body); // already unwrapped, envelope title lifted in
}
}
```
- **Best-effort:** only an `AbortError` (via `options.signal`) rejects; every other
per-key failure comes back as `r.error` (a `CmsNotFoundError`).
- **Match BY `contentKey`, never positionally** — each result echoes the requested
key even though the toolkit remaps source→target internally.
- Keys are catalog-remapped (fail-open) and the channel resolves exactly as the
single-key read — `references/package-api.md`.
## contentKey-only + mixed pages
Only `contentKey`s batch. A `CmsExternalRef` (public `unauthenticatedUrl`) has no
contentKey and is often a different channel/org — for news/structured content read it
with `getCmsContentByUrl` individually. A mixed list becomes 1 bulk call for the key
subset + N individual CDN fetches; wire the results into your own components. When you
render one card per ref instead, each card's independent read already isolates failures.
(A foreign `url` **media** ref is not fetched at all — its url is the asset src directly,
Rule 1 — so it neither batches nor needs an individual read.)
## Out of scope
No DYNAMIC feed ("latest 10 news") — `getCmsContentByKeys` reads KNOWN keys; it
does not discover or query a collection. Endpoint + response contract:
`references/package-api.md`. Failure rows: `references/failure-modes.md`.
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| brainstormingobra/superpowersYou MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or planning anything new, in software or out of it (a talk, a business, a renovation). | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| brand-guidelinesanthropics/skillsApplies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand colors or style guidelines, visual formatting, or company design standards apply. | Stars: 197k | Updated | Claude CodeCodex | Verified | Install |
| frontend-designanthropics/skillsGuidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making choices that don't read as templated defaults. | Stars: 197k | Updated | Claude CodeCodex | Verified | Install |
| mcp-builderanthropics/skillsGuide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when building MCP servers to integrate external APIs or services, whether in Python (FastMCP) or Node/TypeScript (MCP SDK). | Stars: 197k | Updated | Claude CodeCodex | Verified | Install |