Shopify Liquid: 9 Things that have changed in the last 5 years

Поделиться
HTML-код
  • Опубликовано: 12 сен 2024

Комментарии • 12

  • @tanvirkhan81
    @tanvirkhan81 8 месяцев назад

    "Thanks from Bangladesh! Really appreciate your hard work helping folks learn Shopify."

  • @LouisCharlesBlais
    @LouisCharlesBlais 7 месяцев назад

    Something important to understand with Render instead of Include is that you now HAVE to pass in variables. For example, you used to be able to include a snippet and use product attributes inside the snippet if it’s included in a product page but you now have to render the snippet and pass the product object to use its attributes.
    Much more performant but tricky to migrate if you are using external variables in your snippets..
    Btw nice video, I didn’t know the new product media feature, and section index, very helpfull!

  • @bsewall
    @bsewall 7 месяцев назад

    Incredible overview, Chris! One thing I'm exploring is using metafields and metaobjects to make Shopify templates dynamic. For example, an affiliate landing page template where the name, image, quote and discount amount are all customized for each affiliate (in Shopify pages) using metafields/metaobjects, but using only one affiliate lander template. Any blockers you see doing something like this?

    • @CodewithChristheFreelancer
      @CodewithChristheFreelancer  7 месяцев назад +1

      Nup. Just need to understand that metaobjects and metafields are for admins only. I get the question often how frontend users of the website can update the metafields and this is not possible to do without creating an external API. As long as the admin is the one inputting this dynamic data then it should work well.

    • @bsewall
      @bsewall 7 месяцев назад

      @@CodewithChristheFreelancer Thank you! Appreciate the feedback.

  • @SimonS188
    @SimonS188 7 месяцев назад

    Got any tips on accessing a property on a nested metaobject?
    So for example a Car metaobject has a list of Seat meta-objects. And the Seat meta-object has a colour property. Do we have anyway to iterate out all the Seat colours for a given Car.
    A question i've been trying to solve since meta-objects first released and to my knowledge, the answer is no, short of making fetch requests to the graphql api which means embedding API credentials in code.
    Still seems to be the biggest blocker to making meta-objects truly useful.

    • @CodewithChristheFreelancer
      @CodewithChristheFreelancer  7 месяцев назад

      Hmm not sure what the blocker is here for you as I'm pretty sure I've been able to achieve what you're describing with metaobjects/metafields. The only thing I noticed was that you can't seem to access an item in a metaobject list directly via its index. Instead, you have to use a forloop.

    • @SimonS188
      @SimonS188 7 месяцев назад

      @@CodewithChristheFreelancer So if we have our two metafields 'Car' and 'Seat' and we say:
      {% for car in shop.metaobjects.car.values %}
      {% for seat in car.seats %}
      {{ seat.colour.value }}
      {% endfor %}
      {% endfor %}
      You actually get nothing, because metaobjects only store a reference to the other metaobject, and the liquid API won't return property values from those references.

    • @CodewithChristheFreelancer
      @CodewithChristheFreelancer  7 месяцев назад

      I suspect you’re probably using slightly wrong syntax.

    • @CodewithChristheFreelancer
      @CodewithChristheFreelancer  7 месяцев назад

      Have you watched my latest videos on Metaobjects and metafields?

    • @SimonS188
      @SimonS188 7 месяцев назад

      @@CodewithChristheFreelancer I have yeah and picked up a couple of new tricks from them. It's why I thought you might have a workaround. No worries if not. It's not a new issue, been around since meta objects were released. Syntax is as is shown on Shopify's own documentation on their dev page for looping through metafields properties.