# Help using nested metaobjects and liquid code

**URL:** <https://community.shopify.com/t/help-using-nested-metaobjects-and-liquid-code/411551>\
**Category:** Technical Q&A\
**Tags:** liquid\
**Created:** [April 29, 2025, 12:08pm UTC](https://community.shopify.com/t/help-using-nested-metaobjects-and-liquid-code/411551 "2025-04-29T12:08:09Z")\
**Posts on this page:** 9\
**Page:** 1

## AI-generated summary

A user is attempting to display nested metaobject data on a Shopify product page for a pen store. The setup involves a product metafield linking to a "Pen Cases" metaobject, which contains fields like case_name, image, and description.

**Initial Problem:**
The user struggled with the correct Liquid syntax to access nested metaobject fields, trying variations like `{{ products.metafields.custom.pen_case.case_name.value }}`.

**Troubleshooting Steps:**
- A helper provided corrected code using `{{ product.metafields.custom.pen_case.case_name }}` (without `.value` for metaobject references)
- When this didn't work, an alternative approach was suggested using `{% assign %}` with explicit `.value` accessors
- Multiple code snippets were shared, including conditional checks and image rendering

**Current Status:**
The issue remains unresolved after trying suggested solutions. The helper requested collaborator access to the Shopify store to diagnose the configuration directly. Screenshots were shared showing how to generate the collaborator access code, and the helper appears to have accessed the store, posting a screenshot asking for confirmation that the displayed result matches expectations.

<div class="post-metadata">

**Author:** ![weaverslodge](https://avatars.discourse-cdn.com/v4/letter/w/e19adc/32.png) [@weaverslodge](https://community.shopify.com/u/weaverslodge)\
**Post date:** [April 29, 2025, 12:08pm UTC](https://community.shopify.com/t/help-using-nested-metaobjects-and-liquid-code/411551/1 "2025-04-29T12:08:09Z")

</div>

Hi Guys,

Please forgive this - I’m sure it will be an easy answer and I’m probably just an idiot but I’m new to all this stuff.

So I am putting together a site selling pens - all of the pen types that I’m selling have their fields in a metaobject, so they have

Name

Type of Pen

Image

Description

Default Case - _Links to the Pen Cases metaobject_

So what I want to do is - on the product page - display all the relevant details of the product but also the default case details.

So I have a metafield called Pen Case which is linked to the Pen Cases metaobject which has the following fields in it

Case Name  
Image

Description

So on my product page I’l trying to add a bit of liquid code to display the Default case for that pen type - I’d like to add the image too but first things first.

so my simplistic understanding of the liquid code would suggest I just need to add

_ **{{ products.metafields.custom.pen\_case.value }}** _ but I figure this will just give me a pointed to another metaobject so I figure I need to go in further and have tried

_ **{{ products.metafields.custom.pen\_case.case\_name.value }}** _

It feels like I’ve tried every combination but I’m worried that I have a fundamental misunderstanding of how this data can be used.

HELP !!! 😀

---

<div class="post-metadata">

**Author:** ![Darshan17](https://avatars.discourse-cdn.com/v4/letter/d/839c29/32.png) [@Darshan17](https://community.shopify.com/u/Darshan17)\
**Post date:** [April 29, 2025, 12:13pm UTC](https://community.shopify.com/t/help-using-nested-metaobjects-and-liquid-code/411551/2 "2025-04-29T12:13:04Z")

</div>

Hi

when you have a metaobject reference, you need to access its fields like this:

```markup
{{ product.metafields.custom.pen_case.case_name }}

```

So on your product page, you should write:

```markup
{% if product.metafields.custom.pen_case %}
  
    ### {{ product.metafields.custom.pen_case.case_name }}
    

{{ product.metafields.custom.pen_case.description }}

    {% if product.metafields.custom.pen_case.image %}
      
    {% endif %}
  

{% endif %}

```

Let me know if this is not solving your problem.

---

<div class="post-metadata">

**Author:** ![weaverslodge](https://avatars.discourse-cdn.com/v4/letter/w/e19adc/32.png) [@weaverslodge](https://community.shopify.com/u/weaverslodge)\
**Post date:** [April 29, 2025, 12:32pm UTC](https://community.shopify.com/t/help-using-nested-metaobjects-and-liquid-code/411551/3 "2025-04-29T12:32:42Z")

</div>

ok - tried that, no joy - I’ve checked that the names used are the ones I’ve said - I can’t see a typo anywhere - I’m stumped as to how to debug it to be honest. Anything else that could be impacting it ?

---

<div class="post-metadata">

**Author:** ![weaverslodge](https://avatars.discourse-cdn.com/v4/letter/w/e19adc/32.png) [@weaverslodge](https://community.shopify.com/u/weaverslodge)\
**Post date:** [May 6, 2025, 12:17pm UTC](https://community.shopify.com/t/help-using-nested-metaobjects-and-liquid-code/411551/4 "2025-05-06T12:17:34Z")

</div>

Anyone got any further ideas - I haven’t managed to spot what the problem is - Is there anything that I can upload to assist diagnosis?

---

<div class="post-metadata">

**Author:** ![Darshan17](https://avatars.discourse-cdn.com/v4/letter/d/839c29/32.png) [@Darshan17](https://community.shopify.com/u/Darshan17)\
**Post date:** [May 6, 2025, 1:48pm UTC](https://community.shopify.com/t/help-using-nested-metaobjects-and-liquid-code/411551/5 "2025-05-06T13:48:43Z")

</div>

You should try this

```markup
{% assign pen_case = product.metafields.custom.pen_case.value %}

{% if pen_case %}
  ### {{ pen_case.case_name.value }}
  

{{ pen_case.description.value }}

  
{% endif %}

```

if this is not working then might be I need Collab access to check everything is set properly.

---

<div class="post-metadata">

**Author:** ![weaverslodge](https://avatars.discourse-cdn.com/v4/letter/w/e19adc/32.png) [@weaverslodge](https://community.shopify.com/u/weaverslodge)\
**Post date:** [May 7, 2025, 1:06pm UTC](https://community.shopify.com/t/help-using-nested-metaobjects-and-liquid-code/411551/6 "2025-05-07T13:06:11Z")

</div>

Hi - no that didn’t work - how do I sort out collab access ?

Thanks for your assist

---

<div class="post-metadata">

**Author:** ![Darshan17](https://avatars.discourse-cdn.com/v4/letter/d/839c29/32.png) [@Darshan17](https://community.shopify.com/u/Darshan17)\
**Post date:** [May 9, 2025, 11:14am UTC](https://community.shopify.com/t/help-using-nested-metaobjects-and-liquid-code/411551/7 "2025-05-09T11:14:00Z")

</div>

I need your store url and collab access code.

---

<div class="post-metadata">

**Author:** ![Darshan17](https://avatars.discourse-cdn.com/v4/letter/d/839c29/32.png) [@Darshan17](https://community.shopify.com/u/Darshan17)\
**Post date:** [May 9, 2025, 12:16pm UTC](https://community.shopify.com/t/help-using-nested-metaobjects-and-liquid-code/411551/8 "2025-05-09T12:16:10Z")

</div>

Hi

Here are the steps to provide the collaborator access code.

 ![Darshan17_0-1746792966235.png](https://canada1.discourse-cdn.com/shopifyforum/original/2X/2/2842bbab13a84cc33fa12545675f932f8981e7f5.png)

Thanks!

---

<div class="post-metadata">

**Author:** ![Darshan17](https://avatars.discourse-cdn.com/v4/letter/d/839c29/32.png) [@Darshan17](https://community.shopify.com/u/Darshan17)\
**Post date:** [May 12, 2025, 10:56am UTC](https://community.shopify.com/t/help-using-nested-metaobjects-and-liquid-code/411551/9 "2025-05-12T10:56:23Z")

</div>

Hi,

can you please confirm ?  
This is what you have expected ?

 ![Darshan17_0-1747047375235.png](https://canada1.discourse-cdn.com/shopifyforum/original/2X/2/271c3d7d8c3629fdaafd2931e5877fa83f936d20.jpeg)

Thanks !
