> For the complete documentation index, see [llms.txt](https://guide.swiftxr.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://guide.swiftxr.io/how-to/how-to-add-the-swiftxr-custom-block-to-the-media-image-section-on-shopify.md).

# How to Add the SwiftXR Custom Block to the Media Image Section on Shopify

## Step 1 — Open Your Theme Editor

1. In your Shopify admin, go to Online Store → Themes.
2. Click Customize on the theme you want to edit.

<figure><img src="/files/HW7jtmP9X5axzw78bAIS" alt=""><figcaption></figcaption></figure>

## Step 2 — Open Your Product Page Template

1. In the top bar of the theme editor, use the dropdown to select a Product Page.
2. Choose the Default product template (or your preferred product template).

<figure><img src="/files/gHrfAENFIIIzpTHIRciX" alt=""><figcaption></figcaption></figure>

### Step 3 **—** Click and Edit the Product Information Section

1. In the **Product Information** or **Media section**, click the 3 dots.
2. Choose Edit Code

<figure><img src="/files/ZP3zP1lTXsqX25PI7xhK" alt=""><figcaption></figcaption></figure>

### **Step 4 — Paste the SwiftXR Embed Code**

Paste the following code into your **Custom Liquid** block:

```
// Some code  {% liquid 
      assign swiftxr_product_url = product.metafields.swiftxr.product_url_api
    %}

    {% if swiftxr_product_url %}

      <div style="width: 100%; height: 450px; margin: 0;"> 
        <iframe title="3D Product" frameborder="0" allowfullscreen mozallowfullscreen="true" webkitallowfullscreen="true" allow="fullscreen; autoplay; camera; midi; encrypted-media; gyroscope; accelerometer; magnetometer; xr-spatial-tracking; microphone;" execution-while-out-of-viewport execution-while-not-rendered web-share width="100%" height="100%" src="{{ swiftxr_product_url }}"> 
        </iframe>
      </div>

    {% endif %}
```

<figure><img src="/files/JhHsT5mjwyFnkMF4g8Sg" alt=""><figcaption></figcaption></figure>

### **Step 5 — Save and Test**

1. Click **Save** in the top right.
2. You should now see the 3D viewer in the media section.

<figure><img src="/files/EU6hH8E28iJ2lW1vqzNl" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://guide.swiftxr.io/how-to/how-to-add-the-swiftxr-custom-block-to-the-media-image-section-on-shopify.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
