1

I did some research but cant seem to wrap my head around having the ability to do this.

I have a couple content types that are currently open to everyone but I would like to collect some information from anonymous users before showing them the content.

I am thinking in some way to utilize webforms in a block and have the questions show up there, what im not sure is how to hide or blur out the content that they are trying to view until they answer the form, as well as how to keep that content open until their next visit.

I am sure you have all seen websites/blogs that do this, to make you register for the site.

Any guidance to how to accomplish this would be very appreciated.

1 Answer 1

3

I'm not aware of a module that does this out of the box. But depending on your details there are a few ways to try to solve this problem.

One solution would be to create your form using Webform or Entity form (assuming your on Drupal 7 a contact form could be used in Drupal 8), place that form in a hidden block on the pages in question. On page load use JavaScript to put the form into a lightbox and set some kind of CSS effect over the rest of the page. When the user completes the form set a cookie so that on the next page load they aren't bothered by the popup. This is a common solution used by News papers trying to enable paywalls but it often means users can bypass the effect by disabling JS.

2
  • Thanks acrosman, thats pretty much where my thinking was going, but wanted to see what was available out of the box. I am hoping I can even utilize the cookie in Webform instead of writing a lot of my own stuff.
    – Roman
    Nov 14, 2016 at 19:32
  • Cookies are easy if you enable the jquery.cookie plugin (available in D7 core) orga.cat/posts/jquerycookie-drupal-7
    – acrosman
    Nov 14, 2016 at 19:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.