Atelier Card Plugin
mp4e:atelier-card is a luxury product card for a tapped garment: colour swatches that recolour it in the video, sizes and Add to bag.
Overview
Atelier card (mp4e:atelier-card, an official plugin) is the card a viewer gets when they tap a garment: its name and price, colour swatches, sizes and other options, and an Add to bag button. It is designed as printed stationery rather than a web form, in three styles: gallery, lookbook and tag.
With Colourways in the video, a swatch picked on the card recolours the garment — and every other piece of its look — in the footage. Without it the card still collects a colour of its own. Add to bag hands the chosen colour and options to the Cart.
Atelier card is a family plugin: it has the family's six themes, its common style settings, its minimum readable size and its keyboard and TV-remote navigation.
Opening a card from a tracked garment
The card is an object card: it opens when the viewer taps a tracked object of a group. A card the viewer taps open closes the Cart's panel, so the two never share the screen.
- Install Atelier card from the marketplace.
- Put the garments in an object group and give each one its data:
title,description,price,priceValue,currencyand, if you like,eyebrowandoptions. - In the group's display settings, add a clicked binding that shows
mp4e:atelier-card, with the card's settings filled from the object's data. - To add to a cart, add a rule on the card's
addToBagevent that calls the Cart'saddItem.
{
"event": "clicked",
"enabled": true,
"display": {
"type": "mp4e:atelier-card",
"config": {
"style": "gallery",
"eyebrow": "{{object.data.eyebrow || ''}}",
"name": "{{object.data.title || ''}}",
"description": "{{object.data.description || ''}}",
"price": "{{object.data.price || ''}}",
"priceValue": "{{object.data.priceValue}}",
"currency": "{{object.data.currency || ''}}",
"options": [ { "id": "size", "label": "Size", "type": "choice", "values": ["S", "M", "L"], "required": true } ],
"optionsOverride": "{{object.data.options || ''}}"
},
"position": { "position": "right", "avoid": "objects" },
"size": { "width": 560, "height": 600 },
"autoClose": { "enabled": true, "closeOn": ["clickOutside", "objectHidden"] }
}
}"plugin:mp4e:atelier-card:addToBag": [
{ "id": "rule_add_to_bag", "name": "Add to bag", "enabled": true,
"actions": [ { "type": "pluginAction", "pluginId": "mp4e:cart", "actionId": "addItem",
"config": { "objectId": "{{eventData.objectId}}", "name": "{{eventData.name}}",
"price": "{{eventData.price}}", "currency": "{{eventData.currency}}",
"quantity": "{{eventData.quantity}}", "variant": "{{eventData.variant}}" } } ] }
]Give the card room: 560 × 600 for the gallery and the tag, 560 × 1000 for the lookbook. The || '' in a template falls back to empty text for a product that has no such field, so a product without an eyebrow or its own options shows no eyebrow and the default options.
Settings
Atelier card's own settings, plus the family's common style settings (theme, accent, size, surface, textColor, font, radius, motion):
| Prop | Type | Default | Description |
|---|---|---|---|
style | 'gallery' | 'lookbook' | 'tag' | 'gallery' | The look of the card (see Styles). |
eyebrow | string | - | A small line above the name ("Look 03", "Resort 27"), e.g. {{object.data.eyebrow || ''}}. |
name | string | - | The piece's name, on up to two lines, e.g. {{object.data.title || ''}}. |
description | string | - | Up to two lines (more on the lookbook sheet), e.g. {{object.data.description || ''}}. |
price | string | - | As shown, with its currency ("$64", "64 €"), e.g. {{object.data.price || ''}}. |
originalPrice | string | - | The price before a sale, struck through next to the price. |
badge | string | - | A word or two ("New", "Limited"). |
image | string | - | A picture from the project's media, or an https address. Empty: no picture (the tag never shows one). |
url | string | - | The piece's page, as an https address. A "View details" link opens it in a new tab. Empty: no link. |
priceValue | number | - | The price as a number (64, 129.5), for Add to bag, e.g. {{object.data.priceValue}}. Without a number above 0 the button reads "Price on request" and adds nothing. |
currency | string | - | The price's three-letter code (USD, EUR, GBP), e.g. {{object.data.currency || ''}}. |
options | Option[] | - | The sizes and other choices (below). |
optionsOverride | string | - | The options as JSON text, usually {{object.data.options || ''}}. When it holds at least one valid option it replaces options, so each product can have its own. |
swatches | { id, name, hex }[] | - | The card's own colours (#rrggbb), used when the garment is in no Colourways look; the colour then travels to the bag only. |
Sizes and other options
options is a list. Three kinds:
| Prop | Type | Default | Description |
|---|---|---|---|
choice | { id, label, type, values, required? } | - | Chips, one selected (a size, a fit). required: true keeps Add to bag from adding until one is picked; the button reads "Select <label>" meanwhile. |
text | { id, label, type, maxLength?, placeholder? } | - | A short text, such as a monogram (30 characters unless maxLength says less, never more than 60). Never required. |
info | { id, label, type, value } | - | A line of display text, such as the fabric. Nothing to choose. |
[
{ "id": "size", "label": "Size", "type": "choice", "values": ["XS", "S", "M", "L"], "required": true },
{ "id": "monogram", "label": "Monogram", "type": "text", "maxLength": 3, "placeholder": "ABC" },
{ "id": "fabric", "label": "Fabric", "type": "info", "value": "Italian crepe" }
]Products rarely share their options (shoes are sized differently from a tote). Put a product's own options in its object data as JSON text, in a field named options, and bind optionsOverride to {{object.data.options || ''}}: a product whose text holds at least one valid option uses it instead of the card's default list.
"options": "[{\"id\":\"size\",\"label\":\"Size (EU)\",\"type\":\"choice\",\"values\":[\"36\",\"37\",\"38\",\"39\"],\"required\":true}]"Colours
- The garment is in a Colourways look: the card shows that look's colours, the chosen one marked. Picking one recolours the garment in the video (all pieces of a linked look) and the card, the selector and every open card show the same choice.
- The garment is in no look: the card shows its own
swatches. The pick does not change the video; it travels to the bag. - With neither, there is no colour row.
The first swatch is always Original, the colour of the video.
Add to bag
While a required choice is missing the button reads Select <label> and takes the viewer to that choice. With everything chosen it reads Add to bag; pressing it emits addToBag and the button shows Added ✓ for a moment. A card without a price as a number (priceValue) reads Price on request and adds nothing.
The Cart keeps a product in two colours or two sizes as two lines, shows the variant under the name, and passes it on in the checkout order.
Styles
- Gallery (default) — an ivory placard with sharp corners: eyebrow, serif name, description, the colours, the options and a ruled foot with the price and ADD TO BAG.
- Lookbook — a tall dark sheet with a light serif name and a full-width bar; a picture is a tall plate at the top. Give it a tall box (560 × 1000).
- Tag — a hang-tag with a notch: eyebrow, name, price and colours first; with options, a button opens a second step with the options and Add to bag (Back or Escape returns to the first).
The ivory, the dark sheet and the serif belong to the card; setting surface, textColor or font hands the corresponding part to your choice, and high contrast does the same for colours.
How it behaves
- The engine places the card beside the garment, clear of the other objects and the player's controls, and moves it only when it would cover another object or leave the frame.
- ✕, Escape and Back close the card (a TV remote's Back and a gamepad's B too); in the tag's second step they go back to the first.
- A keyboard or TV remote moves between the swatches, chips and buttons with the arrows; Enter acts. The text field always types.
- On a phone-sized player the card becomes one column: the picture above the text, the swatches and chips wrapping.
- Everything the card shows is plain text.
Events
| Prop | Type | Default | Description |
|---|---|---|---|
addToBag | { objectId, name, price, currency, quantity, variant? } | - | The viewer pressed Add to bag with every required choice made and a price as a number. price is priceValue, quantity is always 1, and variant is { colour?: { id, name, hex }, options?: { <option id>: value } } — absent when nothing was chosen (the original colour, no options). |
detailsClicked | { objectId, url } | - | The viewer pressed View details; the link opened in a new tab. |
colourPicked | { objectId, colourway } | - | The viewer picked a swatch ("original" for the colour of the video). |
Rules hear them as plugin:mp4e:atelier-card:<event>; your page hears them through onEvent. Atelier card has no actions.