What’s up, guys? Today we’re going to talk about a thing called handleization. Handleization is something that’s in Shopify that takes your file names and puts them in a web safe format. What do I mean by that?

Most servers on the internet run Linux, and Linux has a very unique file system where if you have a file name that looks like this, and then you also have a file name that looks like this, Linux will actually read them as 2 different file names, whereas Windows will see them as a single file name. What does that do? Well, that causes some confusion when you’re trying to look up a file. If we come to what handleization does, handleization basically if you think of it as like a water filter for your file names. It basically takes all the impurities and all the weird stuff that are in your file names, strips them out, and replaces them with really good standards for making your file name.

That’s what Shopify does for you automatically. It takes some of our bad habits and some of the stuff that we’ve gotten used to with using word processors and such in order to put in commas and spaces in our file names, and it strips all that stuff out and it shows you a very clean file name. This can be used in a number of really cool ways. I’m going to hop over to my screen now and show you some of those cool ways, and how handleization within Shopify is actually a very useful tool, and not an annoyance that some people think it is.

Okay, let’s start off with using pages and how Shopify handleizes page titles and so on and so forth, for handles and URL handles. If I’m going to go to my online store, and I’ll go to “Pages”, and I’m going to go and create a new page. I’m going to create a new page, and this page is going to be called “Jody’s Sizing Chart F1I”. What we can see is if we go under “Edit SEO”, we can see that Shopify has automatically handleized the page name. Since this has to be a web safe name, we need to have all of our commas replaced, and all of our spaces replaced, as well as everything needs to be put into lower case. If you look here, we can see that it’s gone and done that for us, so we can go and hit the “Save Page” there.

This is the unique identifier that Shopify uses in order to pull up a specific page from your site. With pages, each page has a handle, and this is the handle that’s generated. If the handle was generated with a quotation mark in it, it would mess up the code and wouldn’t render properly. What would end up happening is the web browser would actually replace the comma with something else. It would probably replace it with a %40, or percent %30 I believe is the correct Unicode for that. We want to make it super easy and readable, and that’s what this handleization does. It doesn’t just do it for pages. It does it for all of your collection. It does it for all your blog posts, and it will also do it for files that you upload to the system. Let’s go over and check that out.

If we go to “Settings”, and we’re going to save this page first, and then when we’re on “Settings”, we’re going to go to “Files”, and I can upload files to Shopify, and it will handleize them automatically for me. Let me go grab a file here.

I’ve now uploaded this file of Sarah the Dog, and you can see it’s gone, and it has replaced all of the spaces in the file names with underscores. That way, when I cut and paste this location that’s given to me by Shopify and pull it up, we will now see a proper URL string, and it pulls up the image like we wanted it to.

That’s showing how it works with inside Shopify when you upload [inaudible 00:04:05]. What if you want to take a stream value and you want to handleize it yourself? That is where we’re going to go on “Liquid Code”. Let’s go to our theme, and we are going to go, and we are going to edit a theme here, and we are going to take the page template. One of the things that we are going to do is we are going to handleize the page title. Say, for example, you wanted to use page titles in order to link them to another collection that has the same title, you wouldn’t be able to do that by title because you might have a problem with the spacing or the way that’s format, but you would be able to do that by handle. What we’re able to do is we’re able to produce a handle by putting in some liquid code. Let’s go and do an example of that.

Let’s take the page title here, “page title”, and then what we’re going to do is we’re going to do a command called “piping”. Piping basically takes whatever your item is and then passes it through a filter. Remember that water filter thing that we had talked about before? We’re going to use that right now. We’re going to pass that through the pipe, and then we’re going to go “Handleize”. You can now see that it pops out the page title properly handleized.

That pretty much covers everything for handleization. There’s a lot of intricate Liquid stuff that you can get into with filters and stuff like that, which we’ll cover in another video, but for now, that kind of wraps up this video. Remember, you can always get ahold of me by leaving a comment down below in the comments, or you can book a call with me, and I’d be happy to walk you through the customization of your Shopify store and what we can maybe do for you. Anyways, that’s everything for today. See you next week.

 

Leave a Reply

You must be logged in to post a comment.