How to work with Metafields on Shopify Themes

แชร์
ฝัง
  • เผยแพร่เมื่อ 28 ส.ค. 2024
  • In this video, we show you how to access meta fields in Liquid, and how to design theme sections to take advantage of this new native functionality. Metafields and dynamic sources allow merchants to easily connect and display different types of content on individual pages of their storefront. By building section settings that leverage dynamic sources, developers can unlock new possibilities for merchants.
    Jump sections
    0:51 Introduction to metafields
    3:58 Accessing metafields in Liquid
    6:33 Accessing metafields in section settings
    10:10 Using dynamic sources
    13:50 Prepopulating section settings
    More info on the metafield Liquid object: shopify.dev/ap...
    More info on working with dynamic sources: shopify.dev/ap...

ความคิดเห็น • 34

  • @CodingWithJan
    @CodingWithJan 2 ปีที่แล้ว +1

    Awesome Liam 😃🙌

  • @eballeste
    @eballeste 2 ปีที่แล้ว +2

    I originally started doing webdev in Wordpress so Shopify's theme editor, at the time, when it comes to content management with instant feedback in the editor, was a breath of fresh air. but after years of using it, it has become sort of a lackluster tool that is getting left behind in the dust because it is missing more powerful tools that other theme editors have like WYSIWYG and multi level repeaters. When it comes to content and content layouts, we find ourselves constantly hitting roadblocks that require hacky solutions.
    OS 2.0 and how it is setup with JSON files is completely inflexible. The current templating system assumes that every single page that shares the same JSON template will have the same exact layout w/dynamic driven data via meta fields but if you want unique layouts for each product, you will need to create a new JSON template for each new layout. This is both inflexible and unsustainable, especially when there is a limit to how many of these JSON templates you can have on your store.

    • @talesfernando7159
      @talesfernando7159 2 ปีที่แล้ว

      This is a problem that I've been looking for a solution for months. What I thought was to create a landing page in some tool and export the html from that landing page to custom html in shopify but I don't know how I can do that.
      Did you manage to think of anything to get around this JSON problem? How can we have different pages that are very personalized without having to create a template for each one?

    • @eballeste
      @eballeste 2 ปีที่แล้ว

      @@talesfernando7159 nothing new unfortunately. we currently have to add a new json template per each new product. luckily they did increase the number of json templates you can use to 1000 so at least there is some breathing room there.

  • @smallsteps3801
    @smallsteps3801 2 ปีที่แล้ว

    Thanks for this video, Liam!

  • @jsmcavady
    @jsmcavady 2 ปีที่แล้ว +1

    I do find metafilds very useful indeed :)

  • @charlene6306
    @charlene6306 2 ปีที่แล้ว

    clear and consise. Excellent

  • @shinyakoizumi601
    @shinyakoizumi601 2 ปีที่แล้ว +4

    It could be useful for non-developer. The new metafield needs to be updated so it will suppport WYSIWYG on multi lineor the multiple picker, and repeatable metafield etc....

    • @liamgriffin6897
      @liamgriffin6897 2 ปีที่แล้ว

      Hi there Shinya - thanks for your suggestion, we are still working on improving the usability of metafields and this is great feedback for us!

  • @timk.
    @timk. 2 ปีที่แล้ว +1

    How can I add two partner products or similar products to the product page with the metafields? For example, if I want to sell two partner shirts, the men's shirt is displayed on the product page of the women's shirt and vice versa. I thought I would just create metafields with the content type URL or reference, then I can select the URL of the partner products on my product pages. The problem is that on the product page in the customizer I can only select pages or text as a dynamic source. The URL or reference metafields don't appear there, which is why I can't select a product. Could you give me a tip if this is possible and if so how? I just want to add Related Products to each product differently via metafields and I can't get it to work^^ Preferably like the Recommended products section, with up to four products. Best regards, Tim

  • @menteZenit
    @menteZenit ปีที่แล้ว

    Useful! Thank you for sharing :)

  • @cyborgmemoirs
    @cyborgmemoirs 4 หลายเดือนก่อน

    Thanks for this video. I see that you were able to add conditional tags to a metafield using the custom liquid section, but is there a way to add conditional when calling from dynamic source? I've been trying to figure out how to make dynamic content from metaobject entries conditional, to no avail (display section if has product has brands metaobject, dont display if blank).

  • @raj-pu9lr
    @raj-pu9lr 2 ปีที่แล้ว +1

    Hey Liam, how to use that emmet like snippet command you're using within editor?

    • @liamgriffin6897
      @liamgriffin6897 2 ปีที่แล้ว

      Hi there Raj - I'm using the Shopify Liquid VS Code extension, which offers some completions: marketplace.visualstudio.com/items?itemName=Shopify.theme-check-vscode

    • @eballeste
      @eballeste 2 ปีที่แล้ว

      @@liamgriffin6897 not in the IDE, he meant how did you do the liquid snippet shortcut within the browser while you were editing the custom liquid field?

  • @quazh3199
    @quazh3199 ปีที่แล้ว

    hi is it possible to bulk edit products and then add metafields to them because i have quite alot of products and would like to add metafields to, than rather doing 1 by 1.

  • @miguelppmachado
    @miguelppmachado 2 ปีที่แล้ว +1

    At the last unite Shopify presented a new are for "pages metafields" called content. At the demo time you announced as coming later this year (2021), can you give as some information about that?

    • @liamgriffin6897
      @liamgriffin6897 2 ปีที่แล้ว

      Hi Miguel! Would this be different to the page reference metafield listed here? shopify.dev/apps/metafields/types

    • @eballeste
      @eballeste 2 ปีที่แล้ว

      @@liamgriffin6897 I'm guessing he meant metafields for the Page resource, (Product, Variants, Collections, etc) which currently doesn't exist and was mentioned in a demo during Shopify Unite

  • @Vtaman65
    @Vtaman65 ปีที่แล้ว

    Great tutorial. I'm using free version of Debutify theme and I'd like to use metafields to shorten my product description but shopify metafields is not showing up on my product page after I create the definitions

  • @phisit8813
    @phisit8813 2 ปีที่แล้ว

    How do I add image in “Collapsible Content” (in “Collapsible row”) ?

  • @omniarte
    @omniarte 2 ปีที่แล้ว +1

    Hi Liam, Thank you for the video. I have a question. How can I add a product of my own choice to the product recommendation section. In the editor you can only add texts and not products.Automatically generated product recommendations are not useful for me. I would like to create metafields for up to four specific products. In the productbackend, the products should then be selected manually, and display as a recommendation to the customer.
    How can I make this work.

    • @liamgriffin6897
      @liamgriffin6897 2 ปีที่แล้ว

      Hi Omniarte! One of the types of metafields is the Product reference type so you could assign specific products to an individual product as metafields. Then you'd need to create a section or block that would render them - so this should be possible to achieve with some custom coding!

    • @omniarte
      @omniarte 2 ปีที่แล้ว

      @@liamgriffin6897 Thank you for your reply.I will do my very best.😀

  • @natanic2746
    @natanic2746 ปีที่แล้ว

    Thanks but how to add app.metafields as a dynamic source in the theme app settings?

  • @klausvennik-consultor-shopify
    @klausvennik-consultor-shopify 10 หลายเดือนก่อน

    Hi! how can i update metafields on customer on shopify?

  • @techjavaid6177
    @techjavaid6177 2 ปีที่แล้ว

    Hi, i have added dynamic section in Shopify and it gets added at the bottom of the page..it want it to appear in the sidebar , i have included the file in the sidebar but it still shows at the bottom..what should i do , please do you have any guide?

    • @liamgriffin6897
      @liamgriffin6897 2 ปีที่แล้ว

      Hi Tech Javaid - it sounds like you'd need the new content to be a block associated with the sidebar section, rather than a completely separate section. Can you customise the sidebar section to include the new content? You may also need to reach out to the theme developer directly for advice on this!

    • @techjavaid6177
      @techjavaid6177 2 ปีที่แล้ว

      @@liamgriffin6897 yes, i am able to print anything in the sidebar..(like filters,- price, color, age etc)...i don't understand, why it is not rendering in the sidebar section

  • @dave0811
    @dave0811 ปีที่แล้ว

    Can metafields be used in a form?
    How?

  • @tubing4marvin
    @tubing4marvin ปีที่แล้ว +1

    try explaining this in simplified terms. bad video

  • @andersbangchristoffersen6490
    @andersbangchristoffersen6490 2 ปีที่แล้ว

    Love it