skip to Main Content

I am using metaObjects in shopify. I have created a metaObject name "Projects" . I created a page "Projects" to display those saved projects through liquid code. It is working as per the requirement on Projects page but now i want to display each project detail on single page. How do i approach this ? Like should i create a page and set a template on it and in that template , fetch the metaobject handle to display its details . I am facing issue like how do i call the same single page for all projects details and display its details. Can someone please guide what is the possible way to get each metaObject values on single project page .

Thanks

2

Answers


  1. After you have created your meta object definition in the Shopify admin you need to then create another definition on your project page with the field type of metaobject I did the following for products to accomplish this :

    1. Created meta-object of benefit and added a single text field.

    2. Created a metafield for product which was called a mixed reference list and referenced the benefits meta object i created.

    3. Added a couple of benefits with the new meta field in the product admin.

    4. Added liquid to display the list of benefits attached to the page :

        {% for item in product.metafields.custom.benefits.value -%}

      • {{ item.benefits }}
      • {%- endfor %}

    I hope this helps!

    Login or Signup to reply.
  2. It seems like you’re on the right track to achieving your goal of displaying each project’s details on a single page in Shopify using metaobjects. My proposed solution involves creating a metafield definition within the custom data settings. Here’s a breakdown of the steps:

    Create Metafield Definition:

    Go to Settings > Custom Data > Pages > Add Definition. Name the definition "Projects" and select "Metaobject" from the "Select Type" dropdown.

    Reference Metaobject:

    After selecting "Metaobject," a "Reference" dropdown will appear. Choose your "Projects" metaobject and select "List of Entries." This creates a connection between the "Projects" page and the individual project entries.

    Select Metafield Definition in Page:

    On the "Projects" page, scroll to the bottom to find the "Metafield" section. You should see the "Metafield Definition" you created. Choose this definition to connect it to the page.

    Connect Dynamic Source in Page Editor:

    In the Shopify page editor, within the first Block of your "Projects" page, use the "Connect dynamic source" feature. Connect it to the "Projects" metaobject that you’ve defined. This step will allow you to dynamically access and display each project’s details on the page.

    Following these steps, you should be able to display each project’s details on individual pages. If you face any issues or have further questions, don’t hesitate to ask. Good luck!

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search