Skip to main content

Dynamic Text

Overview

Some settings in the app allow you to input your own text that will be shown to the customer in certain situations. For example, a download limit exceeded message that will display in the checkout extension when a customer exceeds their download limit. This feature allows you to customize the style and content of that input text. We call this feature 'dynamic text input' and it is closely modeled after markdown with a few additional enhacements.

Supported Inputs

DescriptionInputOutputNotes
Bold**Hello**Hello
Hyperlink[Visit us](https://example.com)Visit usThe link will open in a new tab.
Unordered List Item- item one
- item two
  • item one
  • item two
Each list item must be on a new line.
Ordered List Item1. item one
2. item two
  1. item one
  2. item two
Each list item must be on a new line.
Horizontal Divider---
Must be alone on its own line, with a blank line above and below. In the checkout extension, the divider spans full width.
Line BreakHello<br>WorldHello
World
Tab Spacing<tab>Indented text Indented text
Shopify Metafield{{ resource.namespace.key }}Windows 11See more details below.

Shopify Metafields

This feature allows you to inject shopify metafield values directly into text inputs. When the settings text is visible to customers, the resources metafield value will be injected into the text. For example, if you wanted to configured a warning message for licensed products about ensuring the customer has the correct operating system, you could set operating system metafield on all your products, and then have those metafields directly injected into the warning message. This works for both global, and product level settings. For global setting, the metafield value will be based on whichever product the customer is interacting with.

The input pattern is based on the shopify metafield definitions of resource, namespace, key. You can find these in your admin settings under 'Metafields and metaobjects'. Each resource has it's own metafields, and each metafield will have a namespace and key. To see the namespace and key, first click on the resource, then click on the specific metafield, under the 'Name' input text will be the namespace.key. Enter all three of these inside double brackets as {{ resource.namespace.key }}.

Quality of Life Enhacements

  1. Metafield Validation - real time during input we will validate the format and check with shopify if this is a valid metafield on the specified resource. If valid you will see a ✅, and if invalid you will see a ❌.
    1. For global settings, this is the best we can do at setup time. This is because we don't know which specific resource to grab the value of to show a more accurate text preview.
  2. Metafield Injection Preview - For product & variant level settings we can pull the real metafield values. On input, we will perform metafield validation. On save, we will pull the real real metafield values and inject them into the text preview. This way you can see exactly what your customer will see for a specific product or variant.

Notes

  • We currently only support product and variant metafields.
  • The checkout extension may have very minor deviations from the extension preview. This is due to the fact that Shopify Admin Components are not a 1-1 match with Shopify Checkout Components.