Search code examples
shopifyliquidshopify-template

Shopify get published or unpublished state from Liquid


Is there a method in Liquid that can tell me if a theme is the store's live theme or if it's unpublished?

I am wondering is something like {{ theme.role }} is possible (I know that this particular one was deprecated) and then I would get published or unpublished in return.


Solution

  • {{ theme.role }} - it's available for now, but not documented as far as I see. It returns:

    • main - for published theme
    • unpublished