So today we’re going to talk about Tokenlist. I’ve hinted about Tokenlist in a few videos. Tokenlist is a built-in Miva Merchant tool which will show you all the variables which are available on each page. It’s incredibly powerful and a great resource when you’re developing Miva Merchant stores. Let’s dive in and see how it works. So here, I’m at the Miva Merchant Admin and Tokenlist first needs to be turned on in the store. In order to that you can come here to Menu, scroll down to Utilities, or if I wanted to use the search I could just search for Utilities and come down here to Utility Settings and then I want to come to Add/Remove Modules. So this screen will show me all of the available modules I have that I can assign. If I come down below it will show me modules that are currently installed. So here you’ll see the Tokenlist module. It gives you a short description of what it does and we’re going to come down and click Install. Now if I scroll back down, I see up here it was installed and now I see under installed modules it’s now in this list. Let’s see how to use it.
So Tokenlist attaches itself to every page of the Miva Merchant store. I’m going to go to Storefront and on this storefront page you’ll see this “More” link here. When you click this More link Tokenlist is now an option. So when I click it it brings up this modal window. This has three columns, one for variable, entity and value. If you look it has l.settings which we’ve seen, l.settings:page, what this is showing us is all of the available variables on the storefront page. Now, I come up here to Visible Variables and there’s three different types; Local, Global and System. Now these are three variables types available to Miva Merchant. So what Tokenlist allows you to do is view one or all of these variables.
Tokenlist has great search functionality. Say I wanted to find a specific variable g.domain, Tokenlist will automatically filter the results in real time to show you all the variables that start with g.domain. So what we’re looking at here is the global domain structure. Now if you remember in the previous videos when we were talking about structures there were a couple code based ways to visualize a structure. Well, this is a third way to visualize a structure. It’s actually much easier than using code examples because everything’s available right here at your fingertips. So if I wanted to see what variables available within the main structure I can search for g.domain here and scroll through this and see a nice list of every available variable within that g.domain structure. Not only did it show me the variable of g.domain, but it also shows me the entity which is the syntax I would use to output it to the page and then it also shows me the value of these variables which is very important. So i can easily see what the value of these variables are on the current page which is the storefront page. Because tokenlist gives you access to all the variables in the page, you can use it to see global, local and system variables.
Let’s take a look at the system variables that are available. So here we can either search for s. Which all system variables start with and it will jump to them, or up in this list we can turn off Local and Global variables and just view System. So here this will show you all the System variables that are available within this page. There’s actually quite a few. The ones we were looking at previously were the referer and s.remote_addr, which is the ip address of the user.
So let’s take a look at some of the other features of Tokenlist. I’m going to close this and I’m going to go to the product page and I’m going to pull up Tokenlist. You’ll see here on the Product page, there’s actually two new fields. One for product code and one for category code. What these do is allow you to load in a particular product or load in a particular category and based off that information all the variables and tokenlist will change depending on the product or category that you chose to load in. So if I search for product: it will give me all of the information about that particular product; the name, the price, the image, the description and this is all the same data that would be available if I was viewing the product on the front end.
One other really nice feature of Tokenlist is that it gives you a visual representation of where the tokens are on the page, where these variables are being used. That’s done by this “View All Tokens” button. So when I click it, it’s going to open up a whole new window that will show the front end of the web site, however, I can hover over certain things and it will show me what variables are actually being used. So here we have the product code, the product formatted price, product weight, product description, so this is a great visual way to see what variables are used on the page and where they are placed.
Tokenlist is a fantastic developer tool and once you start using it it will become a go to resource for troubleshooting, testing and identifying variables on a page.