BACK

how to comment out code in shopify liquid

[Shopify Liquid] How To Code in Shopify Liquid (Part 1) hi guys welcome back to websense pro i'm  yo

WebSensePro

Updated on Mar 30,2023

[Shopify Liquid] How To Code in Shopify Liquid (Part 1)

The above is a brief introduction to how to comment out code in shopify liquid

Let's move on to the first section of how to comment out code in shopify liquid

Let TThunt's experts help you find the best TikTok product on your Shopify business!

Find TikTok products (It's Free)
No difficulty
No complicated process
Find winning products
3.5K Ratings

WHY YOU SHOULD CHOOSE TTHUNT

TThunt has the world's largest selection of TikTok products to choose from, and each product has a large number of advertising materials, so you can choose advertising materials for TikTok ads or Facebook ads without any hassle.

how to comment out code in shopify liquid catalogs

[Shopify Liquid] How To Code in Shopify Liquid (Part 1)

hi guys welcome back to websense pro i'm  your host pilan nasir and today we are with  ,a new youtube series where we will learn  the basic of shopify liquid programming  ,and how to code in liquid programming and how to  do some of the basic stuff uh which you should  ,know before starting with shopify so if you want  to learn please take a second and subscribe to  ,this channel and watch out the all so you can be  notified for all of the upcoming videos which i'll  ,be adding in this playlist so uh let's get into  it so first let's understand the back end of the  ,shopify so that's the back end where we have  orders products customers analytics marketing  ,discounts apps and online store we'll be working  mostly in this section where we have our theme,and we are working on the dawn latest version  so today is fifth may 2022 when i'm recording  ,the video the latest version of the dawn  theme is 5.0.0 and we'll be practicing all  ,of the liquid programming uh in this  theme so first of all we will create  ,our first liquid template  and applied it onto a page,so let's click on actions and uh  ,click on edit code where we will  create our first liquid template,so here we can uh here are all the files of the  themes where we have sections snippets assets  ,convert locals we will go through every single  folder one by one in this youtube video series  ,for now we are creating a new template which is  a link which will be a liquid file in our case,we can also create a json file format  uh where all of the sections are pulled  ,through this folder so we will have to quote a  liquid section first in this folder then we can  ,uh create a page template here to apply it  onto a page which will be a dynamic section  ,so for now let's first create a liquid  template to apply it onto a page so you  ,can have a basic understanding of  how the liquid programming works  ,before proceeding further make sure you have  basic knowledge of html and css if you don't have  ,i will put down the link in the description where  you can learn all the basics of html and css  ,i have created multiple videos and a complete  playlist for you to take yourself from a beginner  ,to a professional level in html and css so let's  first click on add a new template and then click  ,on liquid and from the drop down select on page  because we are creating a template for page  ,and then create a new template and  name it new now create a template  ,and here's our new template file which is  being automatically saved in the liquid  ,programming we do not need to uh do a starting tag  in like html we do html and then the ending tag is  ,slash html but in liquid programming we don't need  to add a starting or ending tag just like uh in  ,other programming languages for example in php we  have a starting tag for like this and then ending  ,tag like this so in liquid program we can add  html code we can add css code and we can also add  ,javascript code and liquid code within dot liquid  file so first step like first create a variable  ,and then print the value of that variable which  we can do that really easily by starting with  ,curly bracket version page and then assign  it's like in javascript we use var in in liquid  ,programming we do that we are assign and then is  equal to and then in uh like the variable name  ,which will be new variable so that's my  variable name and it will be equal to first  ,value of my first variable and now let's close  it with percentage and the curly braces so that's  ,the syntax of liquid programming where if you  need to assign a new variable or if you need  ,to run if else condition or if you need to run  a for each loop you will be doing that within  ,version page and the curly braces and to print  the value you will need to have double brackets  ,and now i can just put in my variable to print  the value new variable now this new variable  ,will get the value from here which  we assign on the top now hit save,and apply this template to our  test page so let's go to pages,and these are our pages which  i have created before so  ,i already have test page created go to that one,and from test page you can see that you have  an option to select the template where you can  ,simply select the new template which we created  as you can see we have two templates in our code  ,section one is contact which i might have created  before as i create a lot of shopify tutorials so  ,now well the template which we created  is new so select on that and click save,and now if i preview this  page by clicking on view page  ,you can see that the value of our first  variable has been showing up so that's uh  ,that was our first step where we created our  liquid template and assign a value to a variable,we can also uh print a numeric value so  to add a string value you will need to add  ,commas but uh for the numeric value you can just  uh skip it and add in a numeric value just like 6  ,or like 100 or whatever you want to add in  and then once we hit save you can see that  ,our variable will print the numeric value here  another basic stuff which i'll teach you in  ,this video is how to add comments in shopify so in  html if you have an html code you will have to add,like this so this will be your comment and this  is the starting tag and that's the ending that so  ,that's comment for multi-line comment for html in  php if you put in php if you have any knowledge of  ,php you can see that you will comment it like this  so that's the comment for php in shopify we have,comment like this so that's how we will comment  in shopify so as you can see i have added comment  ,and all of this code which is uh added below  under this comment and comment tag will be  ,commented out and will not be functioning so if  we click save now our code will be commented out,as you can see our page is blank whatever we  can add in here i mean uh testing comments  ,it won't show up because we added a comment,think,cool so that's how the comments work  and uh in next video we'll be learning  ,shopify operators that's how we can play with  operators in shopify liquid so keep watching the  ,videos and don't forget to subscribe let's  learn more about shopify have a great day

Congratulation! You bave finally finished reading how to comment out code in shopify liquid and believe you bave enougb understending how to comment out code in shopify liquid

Come on and read the rest of the article!

Browse More Content