creative designer

If I was designing a password template for a client I'd generally always add the code for that page into a snippet. The reason is pretty simple - it makes it a lot easier to preview the design without locking the store.

Of course this problem doesn't exist if you're following some good practices and developing in a staging account. Not everyone does this, and you need to remember that the merchant may still want to preview things on the live store later.

The setup steps are pretty simple:

  1. Create a new snippet. Let's call it snippet-password.liquid
  2. Edit the password.liquid template file. Cut everything from it except the opening {% layout none %} tag on line 1.
  3. Add {%- include 'snippet-password' -%} on line 2. You should only have two lines of code now
  4. Jump back to the snippet-password.liquid file and paste everything in that you cut earlier.
  5. Next step is to create a new page template. Let's call the new page template password. This will result in a file called page.password.liquid.
  6. Edit that file and delete everything.
  7. Add {%- layout none -%} on line 1
  8. Add {%- include 'snippet-password' -%} on line 2

If you followed the steps correctly you should be able to go to ANY page and view the password page. For example take a look at my experiments store via this url.

The url used has a special querystring in place that loads the alternate template with the matching. So when viewing a page, the ?view=password will load the template page.password.liquid.

Now you and the merchant can check the page design without locking the store.

Like to work with me?

Let's talk