Public
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Boss

How to check if content is gated or not?

I want to check if the page I am on, is gated or not. 

$isGatedContent is a Boolean that reflects the fact that the page requested has some gated content, i.e. that requires the user to login.

This is the case for:

  • Private forums
  • KB articles
  • Pages with some downloadable resources (PDF)

Note:  This value is based on the page content, and does not change when the user logged in:

Case 1) an already logged user arrives on a Private forum.  As the user is logged, the forum is displayed, but $isGatedContent is set to true anyway.

Case 2) a non logged user arrives on a gated page. $isGatedContent is set to true. As unlogged, the user does not see the page /  cant access an attachment .
Then the user logs in è the content is displayed (or the pdf is downloaded…), but $isGatedContent is still set to true.

Is it possible to find this info on page load? 

Give kudos if you find my posts helpful or mark solution if it answers your query
1 Reply 1
Executive

Without knowing more, I feel like the easiest thing to do is to use JavaScript to throw a message to the browser console based on the nature of the content.

 

console.log("Gated content included");

 

 

---
Community Manager \\ NetApp

Welcome to the Technology board!

Curious about our platform? Looking to connect on social technology? You've come to the right place!

Are you a Khoros customer? For direct assistance from our Support team, please visit the Support Forum.