Forum Discussion

lindseyrheapool's avatar
5 years ago

Adding Components Visible Prior to Login Only

Most of the information we have for our support community is customer-specific and therefore locked down pretty tight with roles and permissions. Therefore, we are wanting to create a flashy banner notification (component) on the home dashboard to encourage our customers to log in.  This component only needs to show up on the home page prior to logging in.  Once they log in, we no longer want to show this notification (component).  We have figured out how to do the opposite already (showing components once they log in) but not this.  Any help is appreciated!

  • Hi lindseyrheapool 

    You can do this by wrapping the component code in studio using the following freemarker logic:

    <#if user.anonymous>

    -- component code here --

    </#if>

    In the above scenario, the component will only be displayed to anonymous users, once signed in the condition is no longer true so the code is not loaded.

  • lindseyrheapool,

    You can simply do that by adding this condition to your banner notifications

    <#if user.anonymous>  
    your banner notifications
    </#if>