Email About (includ...
 
Notifications
Clear all

Email About (include) tag ?

2 Posts
2 Users
1 Reactions
244 Views
Aden Mott
(@adenmott)
Eminent Member
Joined: 3 years ago
Posts: 0
Topic starter  

Good afternoon.

I received an email yesterday about the (include) tag being deprecated by Shopify.

I believe this refers to the tag: "% include %" that I am seeing in many of the theme code files.  I have software that will find and replace any text content and want to make sure that I read the email correctly. 

I am seeing 52 instances of "% include".  If I use my software to replace all of this text with "% render" will it update the code accordingly?


   
plaktheme reacted
Quote
plaktheme
(@plaktheme)
Reputable Member
Joined: 5 years ago
Posts: 0
 

Hi @adenmott

Katrine here from Plak theme support,

Yes you are right, the include tag in the mail refer to :

{% include 'snippet_name' %}

 

Whereas the render tag refer to :

{%  render 'snippet_name ' %}

 

The include tag works similarly to the render tag, but it lets the code inside of the snippet to access and overwrite the variables within its parent template. The include tag has been deprecated because the way that it handles variables reduces performance and makes theme code harder to both read and maintain.

But, to answer your question, if you just change the word (include) to (render) in the theme code, it won't work when there are some variables, especially for sections, collections, blocks, media, ...

 

Here is an example from the product template code

- Using include

{% for media in product.media %}
{% include 'media' %}
{% endfor %}

- The wrong way using render

 

{% for media in product.media %}
{% render 'media' %}
{% endfor %}

- The correct way using render

 

{% for media in product.media %}
{% render 'media', media: media %}
{% endfor %}

 

If there was an easy and automatic way to do so, we would have been pleased to do it for our merchants and for free, but as you can see, we need to update each merchant store manually and go through each code and verify that every feature is working properly after the changes and this takes time.

We have successfully updated some merchants stores. If you don't feel comfortable with coding, I highly recommend you hiring our service or a third party developer to make this update.

If you have any specific question in regards to this, feel free to reach out to us 🙂

Katrine

Katrine | Technical support at Plak, Scrowp & Vantout
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as a Solved Solution


   
ReplyQuote
Share:

Welcome to the Shopify Forum Community provided by Plak ThemeLLC, a place where you can discuss about eCommerce and Shopify, solve technical issues, get help with Shopify Design, Apps integration, Marketing, Facebooks ad, Google ads and more.

Before posting, we invite you to read and follow the forum rules | We also support any questions related to Free Shopify themes :Dawn, Express, Minimal, Brooklyn, Narrative, Supply, Debut, Venture, Boundless and Simple