Forum Discussion

cs1991's avatar
cs1991
Expert
11 years ago

Hiding Embedded Video For Guests

We are looking at the possibilities of hosting webinars on our community platform. In the past, we had a registration form that people would fill out and then they would receive a link to our webinar. We want people to be a part of our Community and to provide some additional engagement since some of these webinars are customer-focused. Is there a way to hide an embedded video that can only be seen when logged in? If not, is there is a fun work around that could be setup to limit it's visibility without logging in?

  • cs1991  - If you want it to work globally, add your jQuery code in the header inside the skin wrapper, it will then work on discussion, blogs, ideas and practically everywhere it finds your div id.

     

  • cs1991 - One workaround would be to use jQuery and find the video path, i.e. the div class or ID for it, and see if that is same everytime, and hide it using "user.anonymous", which returns the status of the user, logged in or not.

    • dhiraj_gophane's avatar
      dhiraj_gophane
      Leader
      As Grazitti suggested, you can use "user.anonymous" to check if user has logged in or not. Then you can put a condition in code

      <#if !user.anonymous>
      embedding code goes here
      </#if>
    • cs1991's avatar
      cs1991
      Expert

      Thanks both for the quick reply! I want to run my plan by you to see if I am on the right track before I start diving in.

       

      As VarunGrazitti suggested - I could embed the video with the same unique ID each time. Can I make this a post in the forums/blogs feature and still have the same functionality? If so, then I will just need to setup a custom component with the user.anonymous tag with the Jquery inside the tag.

       

      Does that sound right to you? As a newbie question - If the custom component is the way to go, do I just add the component to the "Forum Message" page type to make it appear when the post is loaded up?

       

      Thanks again for the help! I am having a blast playing around with the possibilities.

      • cs1991  - If you want it to work globally, add your jQuery code in the header inside the skin wrapper, it will then work on discussion, blogs, ideas and practically everywhere it finds your div id.