Shopify
Add the tester with a Custom Liquid section in the theme editor. No app is needed. These steps are for Online Store 2.0 themes such as Dawn, which most current themes are.
Show one family on a page
Use this for a single font's landing page, or the home page.
- In Shopify admin, go to Online Store → Themes and click Customize.
- Choose the page to edit from the menu at the top of the editor.
- In the left sidebar, click Add section and pick Custom Liquid.
- Paste the embed code into the Liquid code box and click Save.
<div data-fontsbox-family="123"></div>
<script src="https://fb-emb.digture.id/embed.js" async></script>A different family on each product
If every product is a different typeface, store the family number on each product with a metafield. Then one block on the product template shows the right tester everywhere.
1. Create the metafield
- Go to Settings → Metafields and metaobjects → Products and click Add definition.
- Name:
Fontsbox family ID. Namespace and key:fontsbox.family_id. - Type: Integer. Click Save.
2. Fill it in for each product
Open a product. In the Metafields section near the bottom, enter the family number, which is the number in data-fontsbox-family="…" in that family's embed code. Save the product.
3. Add the block to the product template
- Go to Online Store → Themes → Customize and open Products → Default product.
- In the Product information section, click Add block and pick Custom Liquid.
- Paste the code below, drag the block where you want it, and click Save.
{% if product.metafields.fontsbox.family_id %}
<div data-fontsbox-family="{{ product.metafields.fontsbox.family_id }}"></div>
<script src="https://fb-emb.digture.id/embed.js" async></script>
{% endif %}Products without a family number don't show a tester.
If your theme has no Custom Liquid block inside Product information, add a Custom Liquid section below it instead. The same code works there.
Loading the script once (optional)
Including the script in each block is fine. If you prefer to load it once for the whole store, go to Online Store → Themes → … → Edit code, open layout/theme.liquid, and paste this just before </body>:
<script src="https://fb-emb.digture.id/embed.js" async></script>After that, your Custom Liquid blocks only need the <div>. Remember to add it again if you switch themes.
Allowed sites for Shopify
If you've set Allowed sites, add both your store's Shopify address and your own domain, for example:
your-store.myshopify.com(used by the theme editor and previews)yourfoundry.com
Don't add just myshopify.com: that would allow every Shopify store.