Mapping fields to products and posts
Before marketers can fill a module from a product or post, a developer tells each field what to fill from. Once a store or site is connected, field settings in the template editor gain a Fill from setting.
Products
Section titled “Products”Shopify and WooCommerce products offer the same properties, so a template mapped for one works with the other.
| Field type | Can fill from |
|---|---|
| Text | Title, price, compare-at price, vendor or product type |
| Image | The product’s image |
| Link | The product page: URL only (keeps the link’s text, such as “Shop now”), or title and URL |
| Toggle | On sale, sold out or in stock |
Toggles are useful for badges: map a “Show sale badge” toggle to On sale and it switches on for discounted products.
Example: a product card
Section titled “Example: a product card”<td data-mm="card" width="180" valign="top"> <img data-mm="image" src="https://example.com/product.jpg" width="180" alt=""> <p data-mm="title" style="margin:8px 0 0;font-weight:600">Waxed jacket</p> <p style="margin:4px 0 0"><span data-mm="price">£180</span> <s data-mm="was">£220</s></p> <a data-mm="link" href="https://example.com">Shop now</a></td>| Field | Type | Fill from |
|---|---|---|
| Image | Image | Image |
| Title | Text | Title |
| Price | Text | Price |
| Was | Text | Compare-at price |
| Show was price | Toggle, removes was | On sale |
| Link | Link | Product page (URL only) |
Put the fields in a repeater on card and marketers can add several products at once.
WordPress posts
Section titled “WordPress posts”Text, rich text, image, link and toggle fields can fill from any output field the connected site shares. The list comes from the site’s plugin settings, so you pick from what’s there rather than typing keys.
| Field type | Fills well from |
|---|---|
| Text | Text and date fields, such as the title |
| Rich text | HTML fields, such as the excerpt or content |
| Image | Image fields, such as the featured image |
| Link | URL fields, such as the permalink. Optionally use the post’s title as the link text. |
| Toggle | True/false fields |
Post types
Section titled “Post types”By default, marketers can pick from any post type the site shares. To narrow it, open the module’s settings or a repeater’s settings and tick the Post types it takes, such as only “Events” for an events module. Ticking a type also lets you map that type’s own fields, not just the fields every type shares.
Latest posts
Section titled “Latest posts”A repeater can fill itself with your newest posts. In the repeater’s settings, turn on Fill with the latest when added and choose:
- How many posts, which fills that many items;
- the Order: Newest first, Recently updated, A to Z or the site’s own order.
When a marketer adds the module, its items fill with the latest posts straight away. Get latest fills them again later, keeping any items the marketer picked by hand or typed over.
- A field fills from a product or a post, never both.
- Changing a field’s type removes its mapping.
- If the connected site stops offering a mapped field, the template shows a warning.
- Mappings only suggest content. Marketers can edit anything a product or post filled.
Try it
Section titled “Try it”Switch the form panel to Preview in the template editor. Pick a product or post to check each field fills as you expect.