In this advanced tutorial, we'll show you how to create a table by using Custom Field values as its contents.
In this example we'll be creating a table from Custom Field values automatically. The coding is generic, you just need to copy and paste it and it will work with the example. No changes necessary.
1.) Create a Global text field titled "Product Table Properties".
This will be where you will define the fields that go in the table and their order. This is a global because it doesn't get directly printed
2.) Create new Product Fields to be displayed in the table.
In this example, we made three different text fields called: "Size", "Type" and "Weight". Make sure to check Exclude from display. This will stop the app from displaying the value of the code in plain text on the page. Save the fields when you are complete.
3.) Now that the properties field is defined, enter the properties you want for the table in your new global field.
In this example, the proper syntax would be as seen below, e.g. [YOUR HUMAN NAME]=[YOUR MACHINE NAME]|[YOUR HUMAN NAME]=[YOUR MACHINE NAME]
4.) Create a new Liquid Template Product Field. This will be the code for our table to display.
It doesn't matter what it's called or what type it is, as we only need it to carry code. Don't exclude it from display this time.
5.) After you click Save New Field, paste this code into the Snippet Editor and click Update Settings.
This code is the table itself and displays the values of your fields from the previous steps.
6.) Add content to your product fields on any products you want to have a the table.