Answers.Body: <p>Depending on your Craft License you could make use of a login form as described inside the docs <a href="https://docs.craftcms.com/v3/dev/examples/login-form.html" rel="nofollow noreferrer">here</a>.</p>
  
  <p>If you got the loginform working, simply use <code>{% requireLogin %}</code> on the site template (i.e. inside the twig template file) that should have restricted access.</p>
  
  <p>If your goal is to just provide an E-Mail without a password you would need to tinker around a bit and maybe just write up a small plugin. To get startet I suggest reading <a href="https://docs.craftcms.com/v3/extend/plugin-guide.html" rel="nofollow noreferrer">this</a> and <a href="https://nystudio107.com/blog/so-you-wanna-make-a-craft-3-plugin" rel="nofollow noreferrer">this</a>. Out of the box this is not possible as far as I know.
  I would advise not just using an E-Mail for validation as <code>ab@c.de</code> for example is a valid E-Mail, though unlikely that it is real. Some sort of login/auth would provide a more solid experience and enforces that the user is real and has validated their E-Mail with the CMS (as craft can send a validation link to given E-Mail after registering with the site).</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-10-22T07:02:11.067Z
Answers.LastActivityDate: 2018-10-22T07:10:51.603Z
Answers.LastEditDate: 2018-10-22T07:10:51.603Z
Answers.UserDisplayName: Eternal Black
Body: <p>I am new to Craft, but one of my clients has a website built in Craft. They would like to "gate" the content on a page of their website. </p>
  
  <p>A. Is it possible to gate content in the Craft CMS? Client wants to add the capability of requiring an email address before viewing the content on a certain page.</p>
  
  <p>B. If it is possible, what are the steps to adding/implementing?</p>
  
  <p>Thank you in advance. </p>
  
Tags: <form>
Title: How Do You Add A Form on a Page to Gate the Content?
ThreadText: # How Do You Add A Form on a Page to Gate the Content?
  
  (Asked by: username_0 on 2018-10-19)
  
  I am new to Craft, but one of my clients has a website built in Craft. They would like to "gate" the content on a page of their website.
  
  A. Is it possible to gate content in the Craft CMS? Client wants to add the capability of requiring an email address before viewing the content on a certain page.
  
  B. If it is possible, what are the steps to adding/implementing?
  
  Thank you in advance.
  
  **Tags:** form
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2018-10-22. Score: 2
  
  Depending on your Craft License you could make use of a login form as described inside the docs [here](https://docs.craftcms.com/v3/dev/examples/login-form.html).
  
  If you got the loginform working, simply use `{% requireLogin %}` on the site template (i.e. inside the twig template file) that should have restricted access.
  
  If your goal is to just provide an E-Mail without a password you would need to tinker around a bit and maybe just write up a small plugin. To get startet I suggest reading [this](https://docs.craftcms.com/v3/extend/plugin-guide.html) and [this](https://nystudio107.com/blog/so-you-wanna-make-a-craft-3-plugin). Out of the box this is not possible as far as I know.
  I would advise not just using an E-Mail for validation as `ab@c.de` for example is a valid E-Mail, though unlikely that it is real. Some sort of login/auth would provide a more solid experience and enforces that the user is real and has validated their E-Mail with the CMS (as craft can send a validation link to given E-Mail after registering with the site).
  
  
  ---
  
  