Forum Discussion

jchen's avatar
jchen
Boss
10 years ago

login component for community pages

My community is currently closed and we're in the process of opening it. Registraiton is a little tricky, but we'd like people to be able to at least view our community--posts, articles, etc.

 

On each of our pages, there's a login component that starts with 

<#if user.anonymous>

 Would we remove this to allow the public access? Or is there something I'm missing? 

  • Hi jchen 

     

    You're welcome.

     

    Apart from the check for whether the user is registered, the component in your post only contains static content - so it shouldn't cause any errors to display it to all users.

     

    To make it visible to all users you need remove the first and last lines (<#if ...> and </#if>).

  • The code you mentioned is the start of a conditional block which will only be processed when the user is not logged in.

     

    Making the content of the community visibile to all users will probably involve changing these types of constraints, however it may not be as simple as just deleting certain lines.

     

    For example, there may still be some content or code logic that you do not want to be processed for anonymous users - this might be content that only applies to logged in users (e.g. profile information), or which should be restricted for some other reason.

     

    Additionally, even if there is no content that should be restricted, you may have code that would fail if processed by a user who is not logged in.

     

    The only way to know what changes to make is to see the code and understand what the restrictions are/should be. Feel free to post some more details if appropriate, and I can probably be more helpful :smileyhappy:

    • jchen's avatar
      jchen
      Boss

      Hi nathan , thanks for your reply! I thought as much. Super thankful for my multiple monitors today, where I can log in to Stage on one browser, and view Stage as a guest, as well as look at different components, on another browser and monitor.

       

      One example is our Discussions component. See below. I know it has to do with the <#if user.registered> part, but wanted to check on how to proceed so I don't break anything.

      <#if user.registered>	
      
      <div id="PublicDiscussionComponentWrapper">
        <div id="PublicDiscussionComponent">
      <table cellspacing="0" cellpadding="0">
      <tr>
            <td class="image" align="center">
              <img height="78" width="104" src="
      /html/assets/hd_discussion.png">  
            </td>
            <td class="text">
              <span class="heading">Public Discussion</span>
              <span class="description">
                  Welcome to the public discussion area. You can read and respond to discussions other people have posted, or create your own discussion in the category of your choice.
              </span>
            </td>
      </tr>
      </table>
        </div>
      </div>
      
      </#if>

      Thanks in advance! 

      • nathan's avatar
        nathan
        Executive

        Hi jchen 

         

        You're welcome.

         

        Apart from the check for whether the user is registered, the component in your post only contains static content - so it shouldn't cause any errors to display it to all users.

         

        To make it visible to all users you need remove the first and last lines (<#if ...> and </#if>).