2

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.

2

Depending on your Craft License you could make use of a login form as described inside the docs here.

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 and this. 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).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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