Forum Discussion

Akenefick's avatar
Akenefick
Genius
4 years ago
Solved

Distinguish Between Stage and Production With FreeMarker

Is there a way to distinguish between Stage and Production using FreeMarker?

 

Thanks

3 Replies

  • This should do it!

    ${config.getString("phase", "prod")}

    If, for some reason, that doesn't work for you, I also found another option in a post from PerBonomi ( Too many tabs? Can't tell Prod and Stage apart anymore? ) :

    <#if current_url?contains("<insert stage-unique url section, e.g. community-stage.site.com>") == true>

    Cheers!

     

  • Akenefick's avatar
    Akenefick
    Genius
    4 years ago

    Both work! That's awesome thanks.

  • <#if env == stage>
    </#if>

    I like this one 😉