Skip to content

Category card partial

One prepared category card.

Output: HTML partial.

This partial receives the local inputs below. It does not define a separate page view model.

Input Type Default / purpose
categoryCard object Prepared category card.
categoryCardDisplayVariant string grid; grid, cards or tiles.
Field Type Meaning Availability
categoryCard.backgroundImage.alt string Alt value supplied for this context. When the parent is provided; check optional fields.
categoryCard.backgroundImage.hasUrl boolean Prepared has URL; use unchanged. When the parent is provided; check optional fields.
categoryCard.backgroundImage.height number Height numeric value. When the parent is provided; check optional fields.
categoryCard.backgroundImage.mediaAssetId number media asset identifier; do not load data with it. When the parent is provided; check optional fields.
categoryCard.backgroundImage.thumbUrl string Prepared thumb URL; use unchanged. When the parent is provided; check optional fields.
categoryCard.backgroundImage.url string Prepared url URL; use unchanged. When the parent is provided; check optional fields.
categoryCard.backgroundImage.width number Width numeric value. When the parent is provided; check optional fields.
categoryCard.categoryId number category identifier; do not load data with it. When the parent is provided; check optional fields.
categoryCard.description string Description value supplied for this context. When the parent is provided; check optional fields.
categoryCard.hasDescription boolean Whether description applies; use for display only. When the parent is provided; check optional fields.
categoryCard.image.alt string Alt value supplied for this context. When the parent is provided; check optional fields.
categoryCard.image.hasUrl boolean Prepared has URL; use unchanged. When the parent is provided; check optional fields.
categoryCard.image.height number Height numeric value. When the parent is provided; check optional fields.
categoryCard.image.mediaAssetId number media asset identifier; do not load data with it. When the parent is provided; check optional fields.
categoryCard.image.thumbUrl string Prepared thumb URL; use unchanged. When the parent is provided; check optional fields.
categoryCard.image.url string Prepared url URL; use unchanged. When the parent is provided; check optional fields.
categoryCard.image.width number Width numeric value. When the parent is provided; check optional fields.
categoryCard.name string Name value supplied for this context. When the parent is provided; check optional fields.
categoryCard.url string Prepared url URL; use unchanged. When the parent is provided; check optional fields.

The reference package uses its bundled theme CSS, Bootstrap and theme JavaScript. Account and checkout controls use the bundled checkout script. Partials use their caller’s resolved assets.

Resolve this partial after setting its documented inputs:

<cfinclude template="#request.resolveStorefrontView('partials/category_card.cfm', viewModel.theme.key)#">

Navigation branches use cfmodule with their documented attributes instead of cfinclude.

Use prepared URLs and labels. Encode plain text and HTML attributes; preserve only explicitly prepared HTML.