All Tutorials

App snippets

All Tutorials

App snippets

App snippets

App snippets are Liquid code that can be included in other Liquid files. They complement app sections by providing a way for apps to include code partials to be rendered in a theme Liquid file. App snippets also allow for more precise injection points within an existing section as opposed to full-width content at the page level.

Add an app snippet

  1. From your Partner Dashboard, click Apps.
  2. Click the name of your app.
  3. Click Extensions.
  4. Click Online Store.
  5. Click Add snippet on the App snippets card.
  6. Add a snippet title. Choose something that is distinct and recognizable because the title can't be changed after you save.
  7. Click Upload file, or drag a liquid file to add it to the app snippet.
  8. Click Save

App snippets are rendered using the {% render %} Liquid tag. The app reference within {% render %} tag is made up of the following components:

  • shopify://apps - this path prefix shows that the snippet comes from an app extension.
  • app name/app snippet name - the name of your app and the name of the snippet you inject in the Liquid file. This helps merchants find and reference the content you are adding to their theme.
  • extension type - whether it's an app section or app snippet.
  • UUID - the app ID. The UUID can be found in your partner dashboard associated with your app extensions registration.
...
{% render "shopify://apps/product-reviews/snippets/star-reviews/5fb1e11a-9ef0-4898-892f-3feba729af78" %}
...

Limitations

App snippets can't render other app snippets or theme snippets.

Testing your app snippet

After you've configured your app snippet, you can use one of the following way to test your app: